Lines Matching refs:dev

50 	struct udevice *bus, *dev;  in dm_test_bus_children_funcs()  local
56 ut_assertok(device_get_child(bus, 0, &dev)); in dm_test_bus_children_funcs()
57 ut_asserteq(-ENODEV, device_get_child(bus, 4, &dev)); in dm_test_bus_children_funcs()
58 ut_assertok(device_get_child_by_seq(bus, 5, &dev)); in dm_test_bus_children_funcs()
59 ut_assert(dev_get_flags(dev) & DM_FLAG_ACTIVATED); in dm_test_bus_children_funcs()
60 ut_asserteq_str("c-test@5", dev->name); in dm_test_bus_children_funcs()
63 ut_asserteq(-ENODEV, device_find_child_by_seq(bus, -1, &dev)); in dm_test_bus_children_funcs()
64 ut_assertok(device_find_child_by_seq(bus, 0, &dev)); in dm_test_bus_children_funcs()
65 ut_assert(!(dev_get_flags(dev) & DM_FLAG_ACTIVATED)); in dm_test_bus_children_funcs()
66 ut_asserteq(0, device_find_child_by_seq(bus, 0, &dev)); in dm_test_bus_children_funcs()
67 ut_assertok(device_get_child_by_seq(bus, 0, &dev)); in dm_test_bus_children_funcs()
68 ut_assert(dev_get_flags(dev) & DM_FLAG_ACTIVATED); in dm_test_bus_children_funcs()
69 ut_asserteq(0, device_find_child_by_seq(bus, 0, &dev)); in dm_test_bus_children_funcs()
72 ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 2, &dev)); in dm_test_bus_children_funcs()
73 ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 2, &dev)); in dm_test_bus_children_funcs()
74 ut_asserteq(-ENODEV, device_get_child_by_seq(bus, 2, &dev)); in dm_test_bus_children_funcs()
78 ut_asserteq(-ENODEV, device_find_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_funcs()
80 ut_asserteq(-ENODEV, device_find_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_funcs()
89 struct udevice *bus, *dev; in dm_test_bus_children_of_offset() local
98 ut_assertok(device_find_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_of_offset()
99 ut_assertnonnull(dev); in dm_test_bus_children_of_offset()
100 ut_assert(!(dev_get_flags(dev) & DM_FLAG_ACTIVATED)); in dm_test_bus_children_of_offset()
101 ut_assertok(device_get_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_of_offset()
102 ut_assertnonnull(dev); in dm_test_bus_children_of_offset()
103 ut_assert(dev_get_flags(dev) & DM_FLAG_ACTIVATED); in dm_test_bus_children_of_offset()
113 struct udevice *bus, *dev, *child; in dm_test_bus_children_iterators() local
117 ut_assertok(device_find_first_child(bus, &dev)); in dm_test_bus_children_iterators()
118 ut_asserteq_str("c-test@5", dev->name); in dm_test_bus_children_iterators()
119 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
120 ut_asserteq_str("c-test@0", dev->name); in dm_test_bus_children_iterators()
121 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
122 ut_asserteq_str("c-test@1", dev->name); in dm_test_bus_children_iterators()
123 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
124 ut_asserteq_ptr(dev, NULL); in dm_test_bus_children_iterators()
127 ut_assertok(device_find_child_by_seq(bus, 5, &dev)); in dm_test_bus_children_iterators()
128 ut_asserteq_str("c-test@5", dev->name); in dm_test_bus_children_iterators()
129 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
130 ut_asserteq_str("c-test@0", dev->name); in dm_test_bus_children_iterators()
133 ut_assertok(device_find_first_child(dev, &child)); in dm_test_bus_children_iterators()
145 struct udevice *bus, *dev; in test_bus_parent_data() local
152 ut_assertok(device_find_child_by_seq(bus, 0, &dev)); in test_bus_parent_data()
153 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in test_bus_parent_data()
154 ut_assertok(device_get_child_by_seq(bus, 0, &dev)); in test_bus_parent_data()
155 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
161 device_remove(dev, DM_REMOVE_NORMAL); in test_bus_parent_data()
162 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in test_bus_parent_data()
165 ut_assertok(device_get_child_by_seq(bus, 0, &dev)); in test_bus_parent_data()
166 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
174 uclass_foreach_dev(dev, uc) { in test_bus_parent_data()
176 if (dev->parent != bus) { in test_bus_parent_data()
177 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in test_bus_parent_data()
180 ut_assertok(device_probe(dev)); in test_bus_parent_data()
181 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
189 uclass_foreach_dev(dev, uc) { in test_bus_parent_data()
191 if (dev->parent != bus) in test_bus_parent_data()
193 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
242 struct udevice *bus, *dev; in dm_test_bus_parent_ops() local
249 uclass_foreach_dev(dev, uc) { in dm_test_bus_parent_ops()
251 if (dev->parent != bus) in dm_test_bus_parent_ops()
253 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in dm_test_bus_parent_ops()
255 ut_assertok(device_probe(dev)); in dm_test_bus_parent_ops()
256 parent_data = dev_get_parent_priv(dev); in dm_test_bus_parent_ops()
260 uclass_foreach_dev(dev, uc) { in dm_test_bus_parent_ops()
262 if (dev->parent != bus) in dm_test_bus_parent_ops()
264 parent_data = dev_get_parent_priv(dev); in dm_test_bus_parent_ops()
266 ut_assertok(device_remove(dev, DM_REMOVE_NORMAL)); in dm_test_bus_parent_ops()
267 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in dm_test_bus_parent_ops()
268 ut_asserteq_ptr(testbus_get_clear_removed(), dev); in dm_test_bus_parent_ops()
278 struct udevice *bus, *dev; in test_bus_parent_plat() local
282 device_find_first_child(bus, &dev); in test_bus_parent_plat()
283 ut_asserteq_ptr(NULL, dev); in test_bus_parent_plat()
287 for (device_find_first_child(bus, &dev); in test_bus_parent_plat()
288 dev; in test_bus_parent_plat()
289 device_find_next_child(&dev)) { in test_bus_parent_plat()
291 plat = dev_get_parent_plat(dev); in test_bus_parent_plat()
300 device_probe(dev); in test_bus_parent_plat()
301 device_remove(dev, DM_REMOVE_NORMAL); in test_bus_parent_plat()
303 ut_asserteq_ptr(plat, dev_get_parent_plat(dev)); in test_bus_parent_plat()
305 ut_assertok(device_probe(dev)); in test_bus_parent_plat()
311 for (device_find_first_child(bus, &dev); in test_bus_parent_plat()
312 dev; in test_bus_parent_plat()
313 device_find_next_child(&dev)) { in test_bus_parent_plat()
315 plat = dev_get_parent_plat(dev); in test_bus_parent_plat()
323 device_find_first_child(bus, &dev); in test_bus_parent_plat()
324 if (dev) in test_bus_parent_plat()
325 device_unbind(dev); in test_bus_parent_plat()
326 } while (dev); in test_bus_parent_plat()
330 for (device_find_first_child(bus, &dev); in test_bus_parent_plat()
331 dev; in test_bus_parent_plat()
332 device_find_next_child(&dev)) { in test_bus_parent_plat()
334 plat = dev_get_parent_plat(dev); in test_bus_parent_plat()
383 struct udevice *bus, *dev; in dm_test_bus_child_post_bind() local
386 for (device_find_first_child(bus, &dev); in dm_test_bus_child_post_bind()
387 dev; in dm_test_bus_child_post_bind()
388 device_find_next_child(&dev)) { in dm_test_bus_child_post_bind()
390 plat = dev_get_parent_plat(dev); in dm_test_bus_child_post_bind()
404 struct udevice *bus, *dev; in dm_test_bus_child_post_bind_uclass() local
407 for (device_find_first_child(bus, &dev); in dm_test_bus_child_post_bind_uclass()
408 dev; in dm_test_bus_child_post_bind_uclass()
409 device_find_next_child(&dev)) { in dm_test_bus_child_post_bind_uclass()
411 plat = dev_get_parent_plat(dev); in dm_test_bus_child_post_bind_uclass()
428 struct udevice *bus, *dev; in dm_test_bus_child_pre_probe_uclass() local
435 for (device_find_first_child(bus, &dev); in dm_test_bus_child_pre_probe_uclass()
436 dev; in dm_test_bus_child_pre_probe_uclass()
437 device_find_next_child(&dev)) { in dm_test_bus_child_pre_probe_uclass()
438 struct dm_test_priv *priv = dev_get_priv(dev); in dm_test_bus_child_pre_probe_uclass()
442 ut_assertok(device_probe(dev)); in dm_test_bus_child_pre_probe_uclass()
444 priv = dev_get_priv(dev); in dm_test_bus_child_pre_probe_uclass()
462 struct udevice *bus, *dev; in dm_test_bus_child_post_probe_uclass() local
469 for (device_find_first_child(bus, &dev); in dm_test_bus_child_post_probe_uclass()
470 dev; in dm_test_bus_child_post_probe_uclass()
471 device_find_next_child(&dev)) { in dm_test_bus_child_post_probe_uclass()
472 struct dm_test_priv *priv = dev_get_priv(dev); in dm_test_bus_child_post_probe_uclass()
476 ut_assertok(device_probe(dev)); in dm_test_bus_child_post_probe_uclass()
478 priv = dev_get_priv(dev); in dm_test_bus_child_post_probe_uclass()