Lines Matching refs:ecomp

250 	struct enclosure_component *ecomp;  in enclosure_component_find_by_name()  local
256 ecomp = &edev->component[i]; in enclosure_component_find_by_name()
257 cname = dev_name(&ecomp->cdev); in enclosure_component_find_by_name()
258 if (ecomp->number != -1 && in enclosure_component_find_by_name()
261 return ecomp; in enclosure_component_find_by_name()
287 struct enclosure_component *ecomp; in enclosure_component_alloc() local
295 ecomp = &edev->component[number]; in enclosure_component_alloc()
297 if (ecomp->number != -1) in enclosure_component_alloc()
300 ecomp->type = type; in enclosure_component_alloc()
301 ecomp->number = number; in enclosure_component_alloc()
302 cdev = &ecomp->cdev; in enclosure_component_alloc()
323 return ecomp; in enclosure_component_alloc()
333 int enclosure_component_register(struct enclosure_component *ecomp) in enclosure_component_register() argument
338 cdev = &ecomp->cdev; in enclosure_component_register()
341 ecomp->number = -1; in enclosure_component_register()
480 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_fault() local
483 edev->cb->get_fault(edev, ecomp); in get_component_fault()
484 return sysfs_emit(buf, "%d\n", ecomp->fault); in get_component_fault()
492 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_fault() local
496 edev->cb->set_fault(edev, ecomp, val); in set_component_fault()
504 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_status() local
507 edev->cb->get_status(edev, ecomp); in get_component_status()
508 return sysfs_emit(buf, "%s\n", enclosure_status[ecomp->status]); in get_component_status()
516 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_status() local
528 edev->cb->set_status(edev, ecomp, i); in set_component_status()
538 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_active() local
541 edev->cb->get_active(edev, ecomp); in get_component_active()
542 return sysfs_emit(buf, "%d\n", ecomp->active); in get_component_active()
550 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_active() local
554 edev->cb->set_active(edev, ecomp, val); in set_component_active()
562 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_locate() local
565 edev->cb->get_locate(edev, ecomp); in get_component_locate()
566 return sysfs_emit(buf, "%d\n", ecomp->locate); in get_component_locate()
574 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_locate() local
578 edev->cb->set_locate(edev, ecomp, val); in set_component_locate()
587 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_power_status() local
590 edev->cb->get_power_status(edev, ecomp); in get_component_power_status()
593 if (ecomp->power_status == -1) in get_component_power_status()
596 return sysfs_emit(buf, "%s\n", str_on_off(ecomp->power_status)); in get_component_power_status()
604 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_power_status() local
617 edev->cb->set_power_status(edev, ecomp, val); in set_component_power_status()
624 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_type() local
626 return sysfs_emit(buf, "%s\n", enclosure_type[ecomp->type]); in get_component_type()
632 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_slot() local
636 if (ecomp->slot >= 0) in get_component_slot()
637 slot = ecomp->slot; in get_component_slot()
639 slot = ecomp->number; in get_component_slot()