dm: test: Add a check that all devices have a dev value
authorSimon Glass <sjg@chromium.org>
Sat, 3 Oct 2020 17:31:31 +0000 (11:31 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 29 Oct 2020 20:42:18 +0000 (14:42 -0600)
commit36af37b9367677f16b09c7d57fb84674979a7a2b
tree72534a9814ba97b05a7f4f54c1fd6d6e103a3796
parentb325248c9368c518d68d00d700404eeac801c98d
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>
drivers/core/device.c
test/dm/of_platdata.c