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()
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 snprintf(buf, 40, "%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 snprintf(buf, 40, "%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 snprintf(buf, 40, "%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 snprintf(buf, 40, "%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 snprintf(buf, 40, "%s\n", ecomp->power_status ? "on" : "off"); 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 snprintf(buf, 40, "%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()