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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user