Lines Matching refs:ecomp

249 	struct enclosure_component *ecomp;  in enclosure_component_find_by_name()  local
255 ecomp = &edev->component[i]; in enclosure_component_find_by_name()
256 cname = dev_name(&ecomp->cdev); in enclosure_component_find_by_name()
257 if (ecomp->number != -1 && in enclosure_component_find_by_name()
260 return ecomp; in enclosure_component_find_by_name()
286 struct enclosure_component *ecomp; in enclosure_component_alloc() local
294 ecomp = &edev->component[number]; in enclosure_component_alloc()
296 if (ecomp->number != -1) in enclosure_component_alloc()
299 ecomp->type = type; in enclosure_component_alloc()
300 ecomp->number = number; in enclosure_component_alloc()
301 cdev = &ecomp->cdev; in enclosure_component_alloc()
322 return ecomp; in enclosure_component_alloc()
332 int enclosure_component_register(struct enclosure_component *ecomp) in enclosure_component_register() argument
337 cdev = &ecomp->cdev; in enclosure_component_register()
340 ecomp->number = -1; in enclosure_component_register()
479 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_fault() local
482 edev->cb->get_fault(edev, ecomp); in get_component_fault()
483 return sysfs_emit(buf, "%d\n", ecomp->fault); in get_component_fault()
491 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_fault() local
495 edev->cb->set_fault(edev, ecomp, val); in set_component_fault()
503 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_status() local
506 edev->cb->get_status(edev, ecomp); in get_component_status()
507 return sysfs_emit(buf, "%s\n", enclosure_status[ecomp->status]); in get_component_status()
515 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_status() local
527 edev->cb->set_status(edev, ecomp, i); in set_component_status()
537 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_active() local
540 edev->cb->get_active(edev, ecomp); in get_component_active()
541 return sysfs_emit(buf, "%d\n", ecomp->active); in get_component_active()
549 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_active() local
553 edev->cb->set_active(edev, ecomp, val); in set_component_active()
561 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_locate() local
564 edev->cb->get_locate(edev, ecomp); in get_component_locate()
565 return sysfs_emit(buf, "%d\n", ecomp->locate); in get_component_locate()
573 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_locate() local
577 edev->cb->set_locate(edev, ecomp, val); in set_component_locate()
586 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_power_status() local
589 edev->cb->get_power_status(edev, ecomp); in get_component_power_status()
592 if (ecomp->power_status == -1) in get_component_power_status()
595 return sysfs_emit(buf, "%s\n", ecomp->power_status ? "on" : "off"); in get_component_power_status()
603 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_power_status() local
616 edev->cb->set_power_status(edev, ecomp, val); in set_component_power_status()
623 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_type() local
625 return sysfs_emit(buf, "%s\n", enclosure_type[ecomp->type]); in get_component_type()
631 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_slot() local
635 if (ecomp->slot >= 0) in get_component_slot()
636 slot = ecomp->slot; in get_component_slot()
638 slot = ecomp->number; in get_component_slot()