Lines Matching full:dev

107 	struct udevice *dev;  in uclass_destroy()  local
117 dev = list_first_entry(&uc->dev_head, struct udevice, in uclass_destroy()
119 ret = device_remove(dev, DM_REMOVE_NORMAL); in uclass_destroy()
122 ret = device_unbind(dev); in uclass_destroy()
177 struct udevice *dev; in uclass_find_device() local
187 list_for_each_entry(dev, &uc->dev_head, uclass_node) { in uclass_find_device()
189 *devp = dev; in uclass_find_device()
216 struct udevice *dev = *devp; in uclass_find_next_device() local
219 if (list_is_last(&dev->uclass_node, &dev->uclass->dev_head)) in uclass_find_next_device()
222 *devp = list_entry(dev->uclass_node.next, struct udevice, uclass_node); in uclass_find_next_device()
231 struct udevice *dev; in uclass_find_device_by_name() local
241 list_for_each_entry(dev, &uc->dev_head, uclass_node) { in uclass_find_device_by_name()
242 if (!strncmp(dev->name, name, strlen(name))) { in uclass_find_device_by_name()
243 *devp = dev; in uclass_find_device_by_name()
255 struct udevice *dev; in uclass_find_device_by_seq() local
266 list_for_each_entry(dev, &uc->dev_head, uclass_node) { in uclass_find_device_by_seq()
267 debug(" - %d %d '%s'\n", dev->req_seq, dev->seq, dev->name); in uclass_find_device_by_seq()
268 if ((find_req_seq ? dev->req_seq : dev->seq) == in uclass_find_device_by_seq()
270 *devp = dev; in uclass_find_device_by_seq()
284 struct udevice *dev; in uclass_find_device_by_of_offset() local
294 list_for_each_entry(dev, &uc->dev_head, uclass_node) { in uclass_find_device_by_of_offset()
295 if (dev_of_offset(dev) == node) { in uclass_find_device_by_of_offset()
296 *devp = dev; in uclass_find_device_by_of_offset()
308 struct udevice *dev; in uclass_find_device_by_ofnode() local
318 list_for_each_entry(dev, &uc->dev_head, uclass_node) { in uclass_find_device_by_ofnode()
319 if (ofnode_equal(dev_ofnode(dev), node)) { in uclass_find_device_by_ofnode()
320 *devp = dev; in uclass_find_device_by_ofnode()
334 struct udevice *dev; in uclass_find_device_by_phandle() local
347 list_for_each_entry(dev, &uc->dev_head, uclass_node) { in uclass_find_device_by_phandle()
350 phandle = dev_read_phandle(dev); in uclass_find_device_by_phandle()
353 *devp = dev; in uclass_find_device_by_phandle()
366 struct udevice *dev; in uclass_get_device_by_driver() local
374 list_for_each_entry(dev, &uc->dev_head, uclass_node) { in uclass_get_device_by_driver()
375 if (dev->driver == find_drv) in uclass_get_device_by_driver()
376 return uclass_get_device_tail(dev, 0, devp); in uclass_get_device_by_driver()
382 int uclass_get_device_tail(struct udevice *dev, int ret, struct udevice **devp) in uclass_get_device_tail() argument
387 assert(dev); in uclass_get_device_tail()
388 ret = device_probe(dev); in uclass_get_device_tail()
392 *devp = dev; in uclass_get_device_tail()
399 struct udevice *dev; in uclass_get_device() local
403 ret = uclass_find_device(id, index, &dev); in uclass_get_device()
404 return uclass_get_device_tail(dev, ret, devp); in uclass_get_device()
410 struct udevice *dev; in uclass_get_device_by_name() local
414 ret = uclass_find_device_by_name(id, name, &dev); in uclass_get_device_by_name()
415 return uclass_get_device_tail(dev, ret, devp); in uclass_get_device_by_name()
420 struct udevice *dev; in uclass_get_device_by_seq() local
424 ret = uclass_find_device_by_seq(id, seq, false, &dev); in uclass_get_device_by_seq()
430 ret = uclass_find_device_by_seq(id, seq, true, &dev); in uclass_get_device_by_seq()
432 return uclass_get_device_tail(dev, ret, devp); in uclass_get_device_by_seq()
438 struct udevice *dev; in uclass_get_device_by_of_offset() local
442 ret = uclass_find_device_by_of_offset(id, node, &dev); in uclass_get_device_by_of_offset()
443 return uclass_get_device_tail(dev, ret, devp); in uclass_get_device_by_of_offset()
449 struct udevice *dev; in uclass_get_device_by_ofnode() local
453 ret = uclass_find_device_by_ofnode(id, node, &dev); in uclass_get_device_by_ofnode()
455 return uclass_get_device_tail(dev, ret, devp); in uclass_get_device_by_ofnode()
462 struct udevice *dev; in uclass_get_device_by_phandle_id() local
471 list_for_each_entry(dev, &uc->dev_head, uclass_node) { in uclass_get_device_by_phandle_id()
474 phandle = dev_read_phandle(dev); in uclass_get_device_by_phandle_id()
477 *devp = dev; in uclass_get_device_by_phandle_id()
478 return uclass_get_device_tail(dev, ret, devp); in uclass_get_device_by_phandle_id()
488 struct udevice *dev; in uclass_get_device_by_phandle() local
492 ret = uclass_find_device_by_phandle(id, parent, name, &dev); in uclass_get_device_by_phandle()
493 return uclass_get_device_tail(dev, ret, devp); in uclass_get_device_by_phandle()
499 struct udevice *dev; in uclass_first_device() local
503 ret = uclass_find_first_device(id, &dev); in uclass_first_device()
504 if (!dev) in uclass_first_device()
506 return uclass_get_device_tail(dev, ret, devp); in uclass_first_device()
524 struct udevice *dev = *devp; in uclass_next_device() local
528 ret = uclass_find_next_device(&dev); in uclass_next_device()
529 if (!dev) in uclass_next_device()
531 return uclass_get_device_tail(dev, ret, devp); in uclass_next_device()
561 int uclass_bind_device(struct udevice *dev) in uclass_bind_device() argument
566 uc = dev->uclass; in uclass_bind_device()
567 list_add_tail(&dev->uclass_node, &uc->dev_head); in uclass_bind_device()
569 if (dev->parent) { in uclass_bind_device()
570 struct uclass_driver *uc_drv = dev->parent->uclass->uc_drv; in uclass_bind_device()
573 ret = uc_drv->child_post_bind(dev); in uclass_bind_device()
582 list_del(&dev->uclass_node); in uclass_bind_device()
588 int uclass_unbind_device(struct udevice *dev) in uclass_unbind_device() argument
593 uc = dev->uclass; in uclass_unbind_device()
595 ret = uc->uc_drv->pre_unbind(dev); in uclass_unbind_device()
600 list_del(&dev->uclass_node); in uclass_unbind_device()
605 int uclass_resolve_seq(struct udevice *dev) in uclass_resolve_seq() argument
611 assert(dev->seq == -1); in uclass_resolve_seq()
612 ret = uclass_find_device_by_seq(dev->uclass->uc_drv->id, dev->req_seq, in uclass_resolve_seq()
616 dev->name, dev->req_seq, dup->name); in uclass_resolve_seq()
619 if (dev->req_seq != -1) in uclass_resolve_seq()
620 return dev->req_seq; in uclass_resolve_seq()
626 ret = uclass_find_device_by_seq(dev->uclass->uc_drv->id, seq, in uclass_resolve_seq()
636 int uclass_pre_probe_device(struct udevice *dev) in uclass_pre_probe_device() argument
641 uc_drv = dev->uclass->uc_drv; in uclass_pre_probe_device()
643 ret = uc_drv->pre_probe(dev); in uclass_pre_probe_device()
648 if (!dev->parent) in uclass_pre_probe_device()
650 uc_drv = dev->parent->uclass->uc_drv; in uclass_pre_probe_device()
652 return uc_drv->child_pre_probe(dev); in uclass_pre_probe_device()
657 int uclass_post_probe_device(struct udevice *dev) in uclass_post_probe_device() argument
659 struct uclass_driver *uc_drv = dev->uclass->uc_drv; in uclass_post_probe_device()
662 return uc_drv->post_probe(dev); in uclass_post_probe_device()
668 int uclass_pre_remove_device(struct udevice *dev) in uclass_pre_remove_device() argument
673 uc = dev->uclass; in uclass_pre_remove_device()
675 ret = uc->uc_drv->pre_remove(dev); in uclass_pre_remove_device()