dm: treewide: Rename auto_alloc_size members to be shorter
This construct is quite long-winded. In earlier days it made some sense since auto-allocation was a strange concept. But with driver model now used pretty universally, we can shorten this to 'auto'. This reduces verbosity and makes it easier to read. Coincidentally it also ensures that every declaration is on one line, thus making dtoc's job easier. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
@@ -110,7 +110,7 @@ U_BOOT_DRIVER(testacpi_drv) = {
|
||||
.of_match = testacpi_ids,
|
||||
.id = UCLASS_TEST_ACPI,
|
||||
.bind = dm_scan_fdt_dev,
|
||||
.platdata_auto_alloc_size = sizeof(struct testacpi_platdata),
|
||||
.platdata_auto = sizeof(struct testacpi_platdata),
|
||||
ACPI_OPS_PTR(&testacpi_ops)
|
||||
};
|
||||
|
||||
|
||||
@@ -100,10 +100,10 @@ U_BOOT_DRIVER(testbus_drv) = {
|
||||
.id = UCLASS_TEST_BUS,
|
||||
.probe = testbus_drv_probe,
|
||||
.child_post_bind = testbus_child_post_bind,
|
||||
.priv_auto_alloc_size = sizeof(struct dm_test_priv),
|
||||
.platdata_auto_alloc_size = sizeof(struct dm_test_pdata),
|
||||
.per_child_auto_alloc_size = sizeof(struct dm_test_parent_data),
|
||||
.per_child_platdata_auto_alloc_size =
|
||||
.priv_auto = sizeof(struct dm_test_priv),
|
||||
.platdata_auto = sizeof(struct dm_test_pdata),
|
||||
.per_child_auto = sizeof(struct dm_test_parent_data),
|
||||
.per_child_platdata_auto =
|
||||
sizeof(struct dm_test_parent_platdata),
|
||||
.child_pre_probe = testbus_child_pre_probe,
|
||||
.child_post_remove = testbus_child_post_remove,
|
||||
@@ -312,19 +312,19 @@ static int dm_test_bus_parent_data_uclass(struct unit_test_state *uts)
|
||||
/* Set the driver size to 0 so that the uclass size is used */
|
||||
ut_assertok(uclass_find_device(UCLASS_TEST_BUS, 0, &bus));
|
||||
drv = (struct driver *)bus->driver;
|
||||
size = drv->per_child_auto_alloc_size;
|
||||
size = drv->per_child_auto;
|
||||
|
||||
#ifdef CONFIG_SANDBOX
|
||||
os_mprotect_allow(bus->uclass->uc_drv, sizeof(*bus->uclass->uc_drv));
|
||||
os_mprotect_allow(drv, sizeof(*drv));
|
||||
#endif
|
||||
bus->uclass->uc_drv->per_child_auto_alloc_size = size;
|
||||
drv->per_child_auto_alloc_size = 0;
|
||||
bus->uclass->uc_drv->per_child_auto = size;
|
||||
drv->per_child_auto = 0;
|
||||
ret = test_bus_parent_data(uts);
|
||||
if (ret)
|
||||
return ret;
|
||||
bus->uclass->uc_drv->per_child_auto_alloc_size = 0;
|
||||
drv->per_child_auto_alloc_size = size;
|
||||
bus->uclass->uc_drv->per_child_auto = 0;
|
||||
drv->per_child_auto = size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -456,18 +456,18 @@ static int dm_test_bus_parent_platdata_uclass(struct unit_test_state *uts)
|
||||
/* Set the driver size to 0 so that the uclass size is used */
|
||||
ut_assertok(uclass_find_device(UCLASS_TEST_BUS, 0, &bus));
|
||||
drv = (struct driver *)bus->driver;
|
||||
size = drv->per_child_platdata_auto_alloc_size;
|
||||
size = drv->per_child_platdata_auto;
|
||||
#ifdef CONFIG_SANDBOX
|
||||
os_mprotect_allow(bus->uclass->uc_drv, sizeof(*bus->uclass->uc_drv));
|
||||
os_mprotect_allow(drv, sizeof(*drv));
|
||||
#endif
|
||||
bus->uclass->uc_drv->per_child_platdata_auto_alloc_size = size;
|
||||
drv->per_child_platdata_auto_alloc_size = 0;
|
||||
bus->uclass->uc_drv->per_child_platdata_auto = size;
|
||||
drv->per_child_platdata_auto = 0;
|
||||
ret = test_bus_parent_platdata(uts);
|
||||
if (ret)
|
||||
return ret;
|
||||
bus->uclass->uc_drv->per_child_platdata_auto_alloc_size = 0;
|
||||
drv->per_child_platdata_auto_alloc_size = size;
|
||||
bus->uclass->uc_drv->per_child_platdata_auto = 0;
|
||||
drv->per_child_platdata_auto = size;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ static int dm_test_autobind_uclass_pdata_alloc(struct unit_test_state *uts)
|
||||
* Test if test uclass driver requires allocation for the uclass
|
||||
* platform data and then check the dev->uclass_platdata pointer.
|
||||
*/
|
||||
ut_assert(uc->uc_drv->per_device_platdata_auto_alloc_size);
|
||||
ut_assert(uc->uc_drv->per_device_platdata_auto);
|
||||
|
||||
for (uclass_find_first_device(UCLASS_TEST, &dev);
|
||||
dev;
|
||||
|
||||
@@ -60,7 +60,7 @@ U_BOOT_DRIVER(emul_mux) = {
|
||||
.of_match = mux_emul_of_match,
|
||||
.ops = &mux_emul_ops,
|
||||
.probe = mux_emul_probe,
|
||||
.priv_auto_alloc_size = sizeof(struct mux_emul_priv),
|
||||
.priv_auto = sizeof(struct mux_emul_priv),
|
||||
};
|
||||
|
||||
static int dm_test_mux_emul_default_state(struct unit_test_state *uts)
|
||||
|
||||
@@ -280,7 +280,7 @@ U_BOOT_DRIVER(regmap_test) = {
|
||||
.of_match = regmaptest_ids,
|
||||
.id = UCLASS_NOP,
|
||||
.probe = remaptest_probe,
|
||||
.priv_auto_alloc_size = sizeof(struct regmaptest_priv),
|
||||
.priv_auto = sizeof(struct regmaptest_priv),
|
||||
};
|
||||
|
||||
static int dm_test_devm_regmap(struct unit_test_state *uts)
|
||||
|
||||
@@ -81,7 +81,7 @@ U_BOOT_DRIVER(test_drv) = {
|
||||
.probe = test_probe,
|
||||
.remove = test_remove,
|
||||
.unbind = test_unbind,
|
||||
.priv_auto_alloc_size = sizeof(struct dm_test_priv),
|
||||
.priv_auto = sizeof(struct dm_test_priv),
|
||||
};
|
||||
|
||||
U_BOOT_DRIVER(test2_drv) = {
|
||||
@@ -92,7 +92,7 @@ U_BOOT_DRIVER(test2_drv) = {
|
||||
.probe = test_probe,
|
||||
.remove = test_remove,
|
||||
.unbind = test_unbind,
|
||||
.priv_auto_alloc_size = sizeof(struct dm_test_priv),
|
||||
.priv_auto = sizeof(struct dm_test_priv),
|
||||
};
|
||||
|
||||
static int test_manual_drv_ping(struct udevice *dev, int pingval, int *pingret)
|
||||
|
||||
@@ -86,8 +86,8 @@ U_BOOT_DRIVER(testfdt_drv) = {
|
||||
.ofdata_to_platdata = testfdt_ofdata_to_platdata,
|
||||
.probe = testfdt_drv_probe,
|
||||
.ops = &test_ops,
|
||||
.priv_auto_alloc_size = sizeof(struct dm_test_priv),
|
||||
.platdata_auto_alloc_size = sizeof(struct dm_test_pdata),
|
||||
.priv_auto = sizeof(struct dm_test_priv),
|
||||
.platdata_auto = sizeof(struct dm_test_pdata),
|
||||
};
|
||||
|
||||
static const struct udevice_id testfdt1_ids[] = {
|
||||
@@ -104,8 +104,8 @@ U_BOOT_DRIVER(testfdt1_drv) = {
|
||||
.ofdata_to_platdata = testfdt_ofdata_to_platdata,
|
||||
.probe = testfdt_drv_probe,
|
||||
.ops = &test_ops,
|
||||
.priv_auto_alloc_size = sizeof(struct dm_test_priv),
|
||||
.platdata_auto_alloc_size = sizeof(struct dm_test_pdata),
|
||||
.priv_auto = sizeof(struct dm_test_priv),
|
||||
.platdata_auto = sizeof(struct dm_test_pdata),
|
||||
.flags = DM_FLAG_PRE_RELOC,
|
||||
};
|
||||
|
||||
@@ -147,7 +147,7 @@ U_BOOT_DRIVER(testprobe_drv) = {
|
||||
.of_match = testprobe_ids,
|
||||
.id = UCLASS_TEST_PROBE,
|
||||
.probe = testprobe_drv_probe,
|
||||
.platdata_auto_alloc_size = sizeof(struct dm_testprobe_pdata),
|
||||
.platdata_auto = sizeof(struct dm_testprobe_pdata),
|
||||
};
|
||||
|
||||
UCLASS_DRIVER(testprobe) = {
|
||||
@@ -204,8 +204,8 @@ U_BOOT_DRIVER(testdevres_drv) = {
|
||||
.bind = testdevres_drv_bind,
|
||||
.ofdata_to_platdata = testdevres_drv_ofdata_to_platdata,
|
||||
.probe = testdevres_drv_probe,
|
||||
.platdata_auto_alloc_size = sizeof(struct dm_testdevres_pdata),
|
||||
.priv_auto_alloc_size = sizeof(struct dm_testdevres_priv),
|
||||
.platdata_auto = sizeof(struct dm_testdevres_pdata),
|
||||
.priv_auto = sizeof(struct dm_testdevres_priv),
|
||||
};
|
||||
|
||||
UCLASS_DRIVER(testdevres) = {
|
||||
|
||||
@@ -124,8 +124,8 @@ UCLASS_DRIVER(test) = {
|
||||
.pre_remove = test_pre_remove,
|
||||
.init = test_init,
|
||||
.destroy = test_destroy,
|
||||
.priv_auto_alloc_size = sizeof(struct dm_test_uclass_priv),
|
||||
.per_device_auto_alloc_size = sizeof(struct dm_test_uclass_perdev_priv),
|
||||
.per_device_platdata_auto_alloc_size =
|
||||
.priv_auto = sizeof(struct dm_test_uclass_priv),
|
||||
.per_device_auto = sizeof(struct dm_test_uclass_perdev_priv),
|
||||
.per_device_platdata_auto =
|
||||
sizeof(struct dm_test_perdev_uc_pdata),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user