dm: core: Use device_foreach_child where possible
We have some nice macros for iterating over devices in device.h, but they
are not used by the driver core. Convert all the users I could find.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
diff --git a/drivers/core/device-remove.c b/drivers/core/device-remove.c
index 73d2e9e..a86b932 100644
--- a/drivers/core/device-remove.c
+++ b/drivers/core/device-remove.c
@@ -29,7 +29,7 @@
assert(dev);
- list_for_each_entry_safe(pos, n, &dev->child_head, sibling_node) {
+ device_foreach_child_safe(pos, n, dev) {
if (drv && (pos->driver != drv))
continue;
@@ -52,7 +52,7 @@
assert(dev);
- list_for_each_entry_safe(pos, n, &dev->child_head, sibling_node) {
+ device_foreach_child_safe(pos, n, dev) {
int ret;
if (drv && (pos->driver != drv))