Lines Matching full:dev
29 static int testbus_drv_probe(struct udevice *dev) in testbus_drv_probe() argument
31 return dm_scan_fdt_dev(dev); in testbus_drv_probe()
34 static int testbus_child_post_bind(struct udevice *dev) in testbus_child_post_bind() argument
38 plat = dev_get_parent_platdata(dev); in testbus_child_post_bind()
45 static int testbus_child_pre_probe(struct udevice *dev) in testbus_child_pre_probe() argument
47 struct dm_test_parent_data *parent_data = dev_get_parent_priv(dev); in testbus_child_pre_probe()
54 static int testbus_child_pre_probe_uclass(struct udevice *dev) in testbus_child_pre_probe_uclass() argument
56 struct dm_test_priv *priv = dev_get_priv(dev); in testbus_child_pre_probe_uclass()
63 static int testbus_child_post_remove(struct udevice *dev) in testbus_child_post_remove() argument
65 struct dm_test_parent_data *parent_data = dev_get_parent_priv(dev); in testbus_child_post_remove()
70 dms->removed = dev; in testbus_child_post_remove()
131 struct udevice *bus, *dev; in dm_test_bus_children_funcs() local
137 ut_assertok(device_get_child(bus, 0, &dev)); in dm_test_bus_children_funcs()
138 ut_asserteq(-ENODEV, device_get_child(bus, 4, &dev)); in dm_test_bus_children_funcs()
139 ut_assertok(device_get_child_by_seq(bus, 5, &dev)); in dm_test_bus_children_funcs()
140 ut_assert(dev->flags & DM_FLAG_ACTIVATED); in dm_test_bus_children_funcs()
141 ut_asserteq_str("c-test@5", dev->name); in dm_test_bus_children_funcs()
144 ut_asserteq(-ENODEV, device_find_child_by_seq(bus, -1, true, &dev)); in dm_test_bus_children_funcs()
145 ut_assertok(device_find_child_by_seq(bus, 0, true, &dev)); in dm_test_bus_children_funcs()
146 ut_assert(!(dev->flags & DM_FLAG_ACTIVATED)); in dm_test_bus_children_funcs()
147 ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 0, false, &dev)); in dm_test_bus_children_funcs()
148 ut_assertok(device_get_child_by_seq(bus, 0, &dev)); in dm_test_bus_children_funcs()
149 ut_assert(dev->flags & DM_FLAG_ACTIVATED); in dm_test_bus_children_funcs()
152 ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 2, false, &dev)); in dm_test_bus_children_funcs()
153 ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 2, true, &dev)); in dm_test_bus_children_funcs()
154 ut_asserteq(-ENODEV, device_get_child_by_seq(bus, 2, &dev)); in dm_test_bus_children_funcs()
158 ut_asserteq(-ENODEV, device_find_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_funcs()
160 ut_asserteq(-ENODEV, device_find_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_funcs()
169 struct udevice *bus, *dev; in dm_test_bus_children_of_offset() local
178 ut_assertok(device_find_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_of_offset()
179 ut_assertnonnull(dev); in dm_test_bus_children_of_offset()
180 ut_assert(!(dev->flags & DM_FLAG_ACTIVATED)); in dm_test_bus_children_of_offset()
181 ut_assertok(device_get_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_of_offset()
182 ut_assertnonnull(dev); in dm_test_bus_children_of_offset()
183 ut_assert(dev->flags & DM_FLAG_ACTIVATED); in dm_test_bus_children_of_offset()
193 struct udevice *bus, *dev, *child; in dm_test_bus_children_iterators() local
197 ut_assertok(device_find_first_child(bus, &dev)); in dm_test_bus_children_iterators()
198 ut_asserteq_str("c-test@5", dev->name); in dm_test_bus_children_iterators()
199 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
200 ut_asserteq_str("c-test@0", dev->name); in dm_test_bus_children_iterators()
201 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
202 ut_asserteq_str("c-test@1", dev->name); in dm_test_bus_children_iterators()
203 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
204 ut_asserteq_ptr(dev, NULL); in dm_test_bus_children_iterators()
207 ut_assertok(device_find_child_by_seq(bus, 5, true, &dev)); in dm_test_bus_children_iterators()
208 ut_asserteq_str("c-test@5", dev->name); in dm_test_bus_children_iterators()
209 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
210 ut_asserteq_str("c-test@0", dev->name); in dm_test_bus_children_iterators()
213 ut_assertok(device_find_first_child(dev, &child)); in dm_test_bus_children_iterators()
225 struct udevice *bus, *dev; in test_bus_parent_data() local
232 ut_assertok(device_find_child_by_seq(bus, 0, true, &dev)); in test_bus_parent_data()
233 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in test_bus_parent_data()
234 ut_assertok(device_get_child_by_seq(bus, 0, &dev)); in test_bus_parent_data()
235 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
241 device_remove(dev, DM_REMOVE_NORMAL); in test_bus_parent_data()
242 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in test_bus_parent_data()
245 ut_assertok(device_get_child_by_seq(bus, 0, &dev)); in test_bus_parent_data()
246 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
254 uclass_foreach_dev(dev, uc) { in test_bus_parent_data()
256 if (dev->parent != bus) { in test_bus_parent_data()
257 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in test_bus_parent_data()
260 ut_assertok(device_probe(dev)); in test_bus_parent_data()
261 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
269 uclass_foreach_dev(dev, uc) { in test_bus_parent_data()
271 if (dev->parent != bus) in test_bus_parent_data()
273 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
318 struct udevice *bus, *dev; in dm_test_bus_parent_ops() local
325 uclass_foreach_dev(dev, uc) { in dm_test_bus_parent_ops()
327 if (dev->parent != bus) in dm_test_bus_parent_ops()
329 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in dm_test_bus_parent_ops()
331 ut_assertok(device_probe(dev)); in dm_test_bus_parent_ops()
332 parent_data = dev_get_parent_priv(dev); in dm_test_bus_parent_ops()
336 uclass_foreach_dev(dev, uc) { in dm_test_bus_parent_ops()
338 if (dev->parent != bus) in dm_test_bus_parent_ops()
340 parent_data = dev_get_parent_priv(dev); in dm_test_bus_parent_ops()
342 ut_assertok(device_remove(dev, DM_REMOVE_NORMAL)); in dm_test_bus_parent_ops()
343 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in dm_test_bus_parent_ops()
344 ut_asserteq_ptr(dms->removed, dev); in dm_test_bus_parent_ops()
355 struct udevice *bus, *dev; in test_bus_parent_platdata() local
360 device_find_first_child(bus, &dev); in test_bus_parent_platdata()
361 ut_asserteq_ptr(NULL, dev); in test_bus_parent_platdata()
365 for (device_find_first_child(bus, &dev), child_count = 0; in test_bus_parent_platdata()
366 dev; in test_bus_parent_platdata()
367 device_find_next_child(&dev)) { in test_bus_parent_platdata()
369 plat = dev_get_parent_platdata(dev); in test_bus_parent_platdata()
378 device_probe(dev); in test_bus_parent_platdata()
379 device_remove(dev, DM_REMOVE_NORMAL); in test_bus_parent_platdata()
381 ut_asserteq_ptr(plat, dev_get_parent_platdata(dev)); in test_bus_parent_platdata()
383 ut_assertok(device_probe(dev)); in test_bus_parent_platdata()
390 for (device_find_first_child(bus, &dev), child_count = 0; in test_bus_parent_platdata()
391 dev; in test_bus_parent_platdata()
392 device_find_next_child(&dev)) { in test_bus_parent_platdata()
394 plat = dev_get_parent_platdata(dev); in test_bus_parent_platdata()
403 device_find_first_child(bus, &dev); in test_bus_parent_platdata()
404 if (dev) in test_bus_parent_platdata()
405 device_unbind(dev); in test_bus_parent_platdata()
406 } while (dev); in test_bus_parent_platdata()
410 for (device_find_first_child(bus, &dev), child_count = 0; in test_bus_parent_platdata()
411 dev; in test_bus_parent_platdata()
412 device_find_next_child(&dev)) { in test_bus_parent_platdata()
414 plat = dev_get_parent_platdata(dev); in test_bus_parent_platdata()
460 struct udevice *bus, *dev; in dm_test_bus_child_post_bind() local
464 for (device_find_first_child(bus, &dev), child_count = 0; in dm_test_bus_child_post_bind()
465 dev; in dm_test_bus_child_post_bind()
466 device_find_next_child(&dev)) { in dm_test_bus_child_post_bind()
468 plat = dev_get_parent_platdata(dev); in dm_test_bus_child_post_bind()
483 struct udevice *bus, *dev; in dm_test_bus_child_post_bind_uclass() local
487 for (device_find_first_child(bus, &dev), child_count = 0; in dm_test_bus_child_post_bind_uclass()
488 dev; in dm_test_bus_child_post_bind_uclass()
489 device_find_next_child(&dev)) { in dm_test_bus_child_post_bind_uclass()
491 plat = dev_get_parent_platdata(dev); in dm_test_bus_child_post_bind_uclass()
509 struct udevice *bus, *dev; in dm_test_bus_child_pre_probe_uclass() local
517 for (device_find_first_child(bus, &dev), child_count = 0; in dm_test_bus_child_pre_probe_uclass()
518 dev; in dm_test_bus_child_pre_probe_uclass()
519 device_find_next_child(&dev)) { in dm_test_bus_child_pre_probe_uclass()
520 struct dm_test_priv *priv = dev_get_priv(dev); in dm_test_bus_child_pre_probe_uclass()
524 ut_assertok(device_probe(dev)); in dm_test_bus_child_pre_probe_uclass()
526 priv = dev_get_priv(dev); in dm_test_bus_child_pre_probe_uclass()