Lines Matching refs:dev
30 static int testbus_drv_probe(struct udevice *dev) in testbus_drv_probe() argument
32 return dm_scan_fdt_dev(dev); in testbus_drv_probe()
35 static int testbus_child_post_bind(struct udevice *dev) in testbus_child_post_bind() argument
39 plat = dev_get_parent_platdata(dev); in testbus_child_post_bind()
46 static int testbus_child_pre_probe(struct udevice *dev) in testbus_child_pre_probe() argument
48 struct dm_test_parent_data *parent_data = dev_get_parent_priv(dev); in testbus_child_pre_probe()
55 static int testbus_child_pre_probe_uclass(struct udevice *dev) in testbus_child_pre_probe_uclass() argument
57 struct dm_test_priv *priv = dev_get_priv(dev); in testbus_child_pre_probe_uclass()
64 static int testbus_child_post_remove(struct udevice *dev) in testbus_child_post_remove() argument
66 struct dm_test_parent_data *parent_data = dev_get_parent_priv(dev); in testbus_child_post_remove()
71 dms->removed = dev; in testbus_child_post_remove()
132 struct udevice *bus, *dev; in dm_test_bus_children_funcs() local
138 ut_assertok(device_get_child(bus, 0, &dev)); in dm_test_bus_children_funcs()
139 ut_asserteq(-ENODEV, device_get_child(bus, 4, &dev)); in dm_test_bus_children_funcs()
140 ut_assertok(device_get_child_by_seq(bus, 5, &dev)); in dm_test_bus_children_funcs()
141 ut_assert(dev->flags & DM_FLAG_ACTIVATED); in dm_test_bus_children_funcs()
142 ut_asserteq_str("c-test@5", dev->name); in dm_test_bus_children_funcs()
145 ut_asserteq(-ENODEV, device_find_child_by_seq(bus, -1, true, &dev)); in dm_test_bus_children_funcs()
146 ut_assertok(device_find_child_by_seq(bus, 0, true, &dev)); in dm_test_bus_children_funcs()
147 ut_assert(!(dev->flags & DM_FLAG_ACTIVATED)); in dm_test_bus_children_funcs()
148 ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 0, false, &dev)); in dm_test_bus_children_funcs()
149 ut_assertok(device_get_child_by_seq(bus, 0, &dev)); in dm_test_bus_children_funcs()
150 ut_assert(dev->flags & DM_FLAG_ACTIVATED); in dm_test_bus_children_funcs()
153 ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 2, false, &dev)); in dm_test_bus_children_funcs()
154 ut_asserteq(-ENODEV, device_find_child_by_seq(bus, 2, true, &dev)); in dm_test_bus_children_funcs()
155 ut_asserteq(-ENODEV, device_get_child_by_seq(bus, 2, &dev)); in dm_test_bus_children_funcs()
159 ut_asserteq(-ENODEV, device_find_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_funcs()
161 ut_asserteq(-ENODEV, device_find_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_funcs()
170 struct udevice *bus, *dev; in dm_test_bus_children_of_offset() local
179 ut_assertok(device_find_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_of_offset()
180 ut_assertnonnull(dev); in dm_test_bus_children_of_offset()
181 ut_assert(!(dev->flags & DM_FLAG_ACTIVATED)); in dm_test_bus_children_of_offset()
182 ut_assertok(device_get_child_by_of_offset(bus, node, &dev)); in dm_test_bus_children_of_offset()
183 ut_assertnonnull(dev); in dm_test_bus_children_of_offset()
184 ut_assert(dev->flags & DM_FLAG_ACTIVATED); in dm_test_bus_children_of_offset()
194 struct udevice *bus, *dev, *child; in dm_test_bus_children_iterators() local
198 ut_assertok(device_find_first_child(bus, &dev)); in dm_test_bus_children_iterators()
199 ut_asserteq_str("c-test@5", dev->name); in dm_test_bus_children_iterators()
200 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
201 ut_asserteq_str("c-test@0", dev->name); in dm_test_bus_children_iterators()
202 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
203 ut_asserteq_str("c-test@1", dev->name); in dm_test_bus_children_iterators()
204 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
205 ut_asserteq_ptr(dev, NULL); in dm_test_bus_children_iterators()
208 ut_assertok(device_find_child_by_seq(bus, 5, true, &dev)); in dm_test_bus_children_iterators()
209 ut_asserteq_str("c-test@5", dev->name); in dm_test_bus_children_iterators()
210 ut_assertok(device_find_next_child(&dev)); in dm_test_bus_children_iterators()
211 ut_asserteq_str("c-test@0", dev->name); in dm_test_bus_children_iterators()
214 ut_assertok(device_find_first_child(dev, &child)); in dm_test_bus_children_iterators()
226 struct udevice *bus, *dev; in test_bus_parent_data() local
233 ut_assertok(device_find_child_by_seq(bus, 0, true, &dev)); in test_bus_parent_data()
234 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in test_bus_parent_data()
235 ut_assertok(device_get_child_by_seq(bus, 0, &dev)); in test_bus_parent_data()
236 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
242 device_remove(dev, DM_REMOVE_NORMAL); in test_bus_parent_data()
243 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in test_bus_parent_data()
246 ut_assertok(device_get_child_by_seq(bus, 0, &dev)); in test_bus_parent_data()
247 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
255 uclass_foreach_dev(dev, uc) { in test_bus_parent_data()
257 if (dev->parent != bus) { in test_bus_parent_data()
258 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in test_bus_parent_data()
261 ut_assertok(device_probe(dev)); in test_bus_parent_data()
262 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
270 uclass_foreach_dev(dev, uc) { in test_bus_parent_data()
272 if (dev->parent != bus) in test_bus_parent_data()
274 parent_data = dev_get_parent_priv(dev); in test_bus_parent_data()
319 struct udevice *bus, *dev; in dm_test_bus_parent_ops() local
326 uclass_foreach_dev(dev, uc) { in dm_test_bus_parent_ops()
328 if (dev->parent != bus) in dm_test_bus_parent_ops()
330 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in dm_test_bus_parent_ops()
332 ut_assertok(device_probe(dev)); in dm_test_bus_parent_ops()
333 parent_data = dev_get_parent_priv(dev); in dm_test_bus_parent_ops()
337 uclass_foreach_dev(dev, uc) { in dm_test_bus_parent_ops()
339 if (dev->parent != bus) in dm_test_bus_parent_ops()
341 parent_data = dev_get_parent_priv(dev); in dm_test_bus_parent_ops()
343 ut_assertok(device_remove(dev, DM_REMOVE_NORMAL)); in dm_test_bus_parent_ops()
344 ut_asserteq_ptr(NULL, dev_get_parent_priv(dev)); in dm_test_bus_parent_ops()
345 ut_asserteq_ptr(dms->removed, dev); in dm_test_bus_parent_ops()
356 struct udevice *bus, *dev; in test_bus_parent_platdata() local
361 device_find_first_child(bus, &dev); in test_bus_parent_platdata()
362 ut_asserteq_ptr(NULL, dev); in test_bus_parent_platdata()
366 for (device_find_first_child(bus, &dev), child_count = 0; in test_bus_parent_platdata()
367 dev; in test_bus_parent_platdata()
368 device_find_next_child(&dev)) { in test_bus_parent_platdata()
370 plat = dev_get_parent_platdata(dev); in test_bus_parent_platdata()
379 device_probe(dev); in test_bus_parent_platdata()
380 device_remove(dev, DM_REMOVE_NORMAL); in test_bus_parent_platdata()
382 ut_asserteq_ptr(plat, dev_get_parent_platdata(dev)); in test_bus_parent_platdata()
384 ut_assertok(device_probe(dev)); in test_bus_parent_platdata()
391 for (device_find_first_child(bus, &dev), child_count = 0; in test_bus_parent_platdata()
392 dev; in test_bus_parent_platdata()
393 device_find_next_child(&dev)) { in test_bus_parent_platdata()
395 plat = dev_get_parent_platdata(dev); in test_bus_parent_platdata()
404 device_find_first_child(bus, &dev); in test_bus_parent_platdata()
405 if (dev) in test_bus_parent_platdata()
406 device_unbind(dev); in test_bus_parent_platdata()
407 } while (dev); in test_bus_parent_platdata()
411 for (device_find_first_child(bus, &dev), child_count = 0; in test_bus_parent_platdata()
412 dev; in test_bus_parent_platdata()
413 device_find_next_child(&dev)) { in test_bus_parent_platdata()
415 plat = dev_get_parent_platdata(dev); in test_bus_parent_platdata()
461 struct udevice *bus, *dev; in dm_test_bus_child_post_bind() local
465 for (device_find_first_child(bus, &dev), child_count = 0; in dm_test_bus_child_post_bind()
466 dev; in dm_test_bus_child_post_bind()
467 device_find_next_child(&dev)) { in dm_test_bus_child_post_bind()
469 plat = dev_get_parent_platdata(dev); in dm_test_bus_child_post_bind()
484 struct udevice *bus, *dev; in dm_test_bus_child_post_bind_uclass() local
488 for (device_find_first_child(bus, &dev), child_count = 0; in dm_test_bus_child_post_bind_uclass()
489 dev; in dm_test_bus_child_post_bind_uclass()
490 device_find_next_child(&dev)) { in dm_test_bus_child_post_bind_uclass()
492 plat = dev_get_parent_platdata(dev); in dm_test_bus_child_post_bind_uclass()
510 struct udevice *bus, *dev; in dm_test_bus_child_pre_probe_uclass() local
518 for (device_find_first_child(bus, &dev), child_count = 0; in dm_test_bus_child_pre_probe_uclass()
519 dev; in dm_test_bus_child_pre_probe_uclass()
520 device_find_next_child(&dev)) { in dm_test_bus_child_pre_probe_uclass()
521 struct dm_test_priv *priv = dev_get_priv(dev); in dm_test_bus_child_pre_probe_uclass()
525 ut_assertok(device_probe(dev)); in dm_test_bus_child_pre_probe_uclass()
527 priv = dev_get_priv(dev); in dm_test_bus_child_pre_probe_uclass()