summaryrefslogtreecommitdiff
path: root/drivers/core
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-10-03 20:31:31 +0300
committerSimon Glass <sjg@chromium.org>2020-10-29 23:42:18 +0300
commit36af37b9367677f16b09c7d57fb84674979a7a2b (patch)
tree72534a9814ba97b05a7f4f54c1fd6d6e103a3796 /drivers/core
parentb325248c9368c518d68d00d700404eeac801c98d (diff)
downloadu-boot-36af37b9367677f16b09c7d57fb84674979a7a2b.tar.xz
dm: test: Add a check that all devices have a dev value
With of-platdata, the driver_info struct is updated with the device pointer when it is bound. This makes it easy for a device to be found by its driver info with the device_get_by_driver_info() function. Add a test that all devices (except the root device) have such an entry. Fix a bug that the function does not set *devp to NULL on failure, which the documentation asserts. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/core')
-rw-r--r--drivers/core/device.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/core/device.c b/drivers/core/device.c
index e90d70101c..746c619cd9 100644
--- a/drivers/core/device.c
+++ b/drivers/core/device.c
@@ -767,6 +767,7 @@ int device_get_by_driver_info(const struct driver_info *info,
struct udevice *dev;
dev = info->dev;
+ *devp = NULL;
return device_get_device_tail(dev, dev ? 0 : -ENOENT, devp);
}