mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
dm: core: Allocate platform data when binding a device
When using allocated platform data, allocate it when we bind the device. This makes it possible to fill in this information before the device is probed. This fits with the platform data model (when not using device tree), since platform data exists at bind-time. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
This commit is contained in:
@@ -143,12 +143,12 @@ static int dm_test_fdt(struct dm_test_state *dms)
|
||||
/* These are num_devices compatible root-level device tree nodes */
|
||||
ut_asserteq(num_devices, list_count_items(&uc->dev_head));
|
||||
|
||||
/* Each should have no platdata / priv */
|
||||
/* Each should have platform data but no private data */
|
||||
for (i = 0; i < num_devices; i++) {
|
||||
ret = uclass_find_device(UCLASS_TEST_FDT, i, &dev);
|
||||
ut_assert(!ret);
|
||||
ut_assert(!dev_get_priv(dev));
|
||||
ut_assert(!dev->platdata);
|
||||
ut_assert(dev->platdata);
|
||||
}
|
||||
|
||||
ut_assertok(dm_check_devices(dms, num_devices));
|
||||
|
||||
Reference in New Issue
Block a user