Lines Matching refs:ecomp
247 struct enclosure_component *ecomp; in enclosure_component_find_by_name() local
253 ecomp = &edev->component[i]; in enclosure_component_find_by_name()
254 cname = dev_name(&ecomp->cdev); in enclosure_component_find_by_name()
255 if (ecomp->number != -1 && in enclosure_component_find_by_name()
258 return ecomp; in enclosure_component_find_by_name()
284 struct enclosure_component *ecomp; in enclosure_component_alloc() local
292 ecomp = &edev->component[number]; in enclosure_component_alloc()
294 if (ecomp->number != -1) in enclosure_component_alloc()
297 ecomp->type = type; in enclosure_component_alloc()
298 ecomp->number = number; in enclosure_component_alloc()
299 cdev = &ecomp->cdev; in enclosure_component_alloc()
320 return ecomp; in enclosure_component_alloc()
330 int enclosure_component_register(struct enclosure_component *ecomp) in enclosure_component_register() argument
335 cdev = &ecomp->cdev; in enclosure_component_register()
338 ecomp->number = -1; in enclosure_component_register()
478 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_fault() local
481 edev->cb->get_fault(edev, ecomp); in get_component_fault()
482 return snprintf(buf, 40, "%d\n", ecomp->fault); in get_component_fault()
490 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_fault() local
494 edev->cb->set_fault(edev, ecomp, val); in set_component_fault()
502 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_status() local
505 edev->cb->get_status(edev, ecomp); in get_component_status()
506 return snprintf(buf, 40, "%s\n", enclosure_status[ecomp->status]); in get_component_status()
514 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_status() local
526 edev->cb->set_status(edev, ecomp, i); in set_component_status()
536 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_active() local
539 edev->cb->get_active(edev, ecomp); in get_component_active()
540 return snprintf(buf, 40, "%d\n", ecomp->active); in get_component_active()
548 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_active() local
552 edev->cb->set_active(edev, ecomp, val); in set_component_active()
560 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_locate() local
563 edev->cb->get_locate(edev, ecomp); in get_component_locate()
564 return snprintf(buf, 40, "%d\n", ecomp->locate); in get_component_locate()
572 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_locate() local
576 edev->cb->set_locate(edev, ecomp, val); in set_component_locate()
585 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_power_status() local
588 edev->cb->get_power_status(edev, ecomp); in get_component_power_status()
591 if (ecomp->power_status == -1) in get_component_power_status()
594 return snprintf(buf, 40, "%s\n", ecomp->power_status ? "on" : "off"); in get_component_power_status()
602 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_power_status() local
615 edev->cb->set_power_status(edev, ecomp, val); in set_component_power_status()
622 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_type() local
624 return snprintf(buf, 40, "%s\n", enclosure_type[ecomp->type]); in get_component_type()
630 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_slot() local
634 if (ecomp->slot >= 0) in get_component_slot()
635 slot = ecomp->slot; in get_component_slot()
637 slot = ecomp->number; in get_component_slot()