Lines Matching refs:ecomp
260 struct enclosure_component *ecomp; in enclosure_component_find_by_name() local
266 ecomp = &edev->component[i]; in enclosure_component_find_by_name()
267 cname = dev_name(&ecomp->cdev); in enclosure_component_find_by_name()
268 if (ecomp->number != -1 && in enclosure_component_find_by_name()
271 return ecomp; in enclosure_component_find_by_name()
297 struct enclosure_component *ecomp; in enclosure_component_alloc() local
305 ecomp = &edev->component[number]; in enclosure_component_alloc()
307 if (ecomp->number != -1) in enclosure_component_alloc()
310 ecomp->type = type; in enclosure_component_alloc()
311 ecomp->number = number; in enclosure_component_alloc()
312 cdev = &ecomp->cdev; in enclosure_component_alloc()
333 return ecomp; in enclosure_component_alloc()
343 int enclosure_component_register(struct enclosure_component *ecomp) in enclosure_component_register() argument
348 cdev = &ecomp->cdev; in enclosure_component_register()
351 ecomp->number = -1; in enclosure_component_register()
492 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_fault() local
495 edev->cb->get_fault(edev, ecomp); in get_component_fault()
496 return snprintf(buf, 40, "%d\n", ecomp->fault); in get_component_fault()
504 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_fault() local
508 edev->cb->set_fault(edev, ecomp, val); in set_component_fault()
516 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_status() local
519 edev->cb->get_status(edev, ecomp); in get_component_status()
520 return snprintf(buf, 40, "%s\n", enclosure_status[ecomp->status]); in get_component_status()
528 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_status() local
540 edev->cb->set_status(edev, ecomp, i); in set_component_status()
550 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_active() local
553 edev->cb->get_active(edev, ecomp); in get_component_active()
554 return snprintf(buf, 40, "%d\n", ecomp->active); in get_component_active()
562 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_active() local
566 edev->cb->set_active(edev, ecomp, val); in set_component_active()
574 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_locate() local
577 edev->cb->get_locate(edev, ecomp); in get_component_locate()
578 return snprintf(buf, 40, "%d\n", ecomp->locate); in get_component_locate()
586 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_locate() local
590 edev->cb->set_locate(edev, ecomp, val); in set_component_locate()
599 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_power_status() local
602 edev->cb->get_power_status(edev, ecomp); in get_component_power_status()
605 if (ecomp->power_status == -1) in get_component_power_status()
608 return snprintf(buf, 40, "%s\n", ecomp->power_status ? "on" : "off"); in get_component_power_status()
616 struct enclosure_component *ecomp = to_enclosure_component(cdev); in set_component_power_status() local
629 edev->cb->set_power_status(edev, ecomp, val); in set_component_power_status()
636 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_type() local
638 return snprintf(buf, 40, "%s\n", enclosure_type[ecomp->type]); in get_component_type()
644 struct enclosure_component *ecomp = to_enclosure_component(cdev); in get_component_slot() local
648 if (ecomp->slot >= 0) in get_component_slot()
649 slot = ecomp->slot; in get_component_slot()
651 slot = ecomp->number; in get_component_slot()