dm: treewide: Rename 'platdata' variables to just 'plat'
We use 'priv' for private data but often use 'platdata' for platform data.
We can't really use 'pdata' since that is ambiguous (it could mean private
or platform data).
Rename some of the latter variables to end with 'plat' for consistency.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/test/dm/acpi.c b/test/dm/acpi.c
index d53f997..d0c49c7 100644
--- a/test/dm/acpi.c
+++ b/test/dm/acpi.c
@@ -110,7 +110,7 @@
.of_match = testacpi_ids,
.id = UCLASS_TEST_ACPI,
.bind = dm_scan_fdt_dev,
- .platdata_auto = sizeof(struct testacpi_platdata),
+ .plat_auto = sizeof(struct testacpi_platdata),
ACPI_OPS_PTR(&testacpi_ops)
};
diff --git a/test/dm/adc.c b/test/dm/adc.c
index 8c6e4b0..740167e 100644
--- a/test/dm/adc.c
+++ b/test/dm/adc.c
@@ -67,7 +67,7 @@
ut_assertok(regulator_set_value(supply, SANDBOX_BUCK2_SET_UV));
ut_asserteq(SANDBOX_BUCK2_SET_UV, regulator_get_value(supply));
- /* Update ADC platdata and get new Vdd value */
+ /* Update ADC plat and get new Vdd value */
ut_assertok(adc_vdd_value(dev, &uV));
ut_asserteq(SANDBOX_BUCK2_SET_UV, uV);
diff --git a/test/dm/blk.c b/test/dm/blk.c
index f34c13f..23940b3 100644
--- a/test/dm/blk.c
+++ b/test/dm/blk.c
@@ -139,7 +139,7 @@
* Check that the block device devnum matches its parent's
* sequence number
*/
- desc = dev_get_uclass_platdata(dev);
+ desc = dev_get_uclass_plat(dev);
ut_asserteq(desc->devnum, i);
}
diff --git a/test/dm/bus.c b/test/dm/bus.c
index c7ad63c..0e83dc1 100644
--- a/test/dm/bus.c
+++ b/test/dm/bus.c
@@ -19,7 +19,7 @@
DECLARE_GLOBAL_DATA_PTR;
-struct dm_test_parent_platdata {
+struct dm_test_parent_plat {
int count;
int bind_flag;
int uclass_bind_flag;
@@ -39,9 +39,9 @@
static int testbus_child_post_bind(struct udevice *dev)
{
- struct dm_test_parent_platdata *plat;
+ struct dm_test_parent_plat *plat;
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
plat->bind_flag = 1;
plat->uclass_bind_flag = 2;
@@ -101,10 +101,10 @@
.probe = testbus_drv_probe,
.child_post_bind = testbus_child_post_bind,
.priv_auto = sizeof(struct dm_test_priv),
- .platdata_auto = sizeof(struct dm_test_pdata),
+ .plat_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),
+ .per_child_plat_auto =
+ sizeof(struct dm_test_parent_plat),
.child_pre_probe = testbus_child_pre_probe,
.child_post_remove = testbus_child_post_remove,
};
@@ -370,9 +370,9 @@
}
DM_TEST(dm_test_bus_parent_ops, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
-static int test_bus_parent_platdata(struct unit_test_state *uts)
+static int test_bus_parent_plat(struct unit_test_state *uts)
{
- struct dm_test_parent_platdata *plat;
+ struct dm_test_parent_plat *plat;
struct udevice *bus, *dev;
/* Check that the bus has no children */
@@ -386,7 +386,7 @@
dev;
device_find_next_child(&dev)) {
/* Check that platform data is allocated */
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
ut_assert(plat != NULL);
/*
@@ -398,7 +398,7 @@
device_probe(dev);
device_remove(dev, DM_REMOVE_NORMAL);
- ut_asserteq_ptr(plat, dev_get_parent_platdata(dev));
+ ut_asserteq_ptr(plat, dev_get_parent_plat(dev));
ut_asserteq(1, plat->count);
ut_assertok(device_probe(dev));
}
@@ -410,7 +410,7 @@
dev;
device_find_next_child(&dev)) {
/* Check that platform data is allocated */
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
ut_assert(plat != NULL);
ut_asserteq(1, plat->count);
}
@@ -423,13 +423,13 @@
device_unbind(dev);
} while (dev);
- /* Now the child platdata should be removed and re-added */
+ /* Now the child plat should be removed and re-added */
device_probe(bus);
for (device_find_first_child(bus, &dev);
dev;
device_find_next_child(&dev)) {
/* Check that platform data is allocated */
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
ut_assert(plat != NULL);
ut_asserteq(0, plat->count);
}
@@ -439,14 +439,14 @@
}
/* Test that the bus can store platform data about each child */
-static int dm_test_bus_parent_platdata(struct unit_test_state *uts)
+static int dm_test_bus_parent_plat(struct unit_test_state *uts)
{
- return test_bus_parent_platdata(uts);
+ return test_bus_parent_plat(uts);
}
-DM_TEST(dm_test_bus_parent_platdata, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
+DM_TEST(dm_test_bus_parent_plat, UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
/* As above but the size is controlled by the uclass */
-static int dm_test_bus_parent_platdata_uclass(struct unit_test_state *uts)
+static int dm_test_bus_parent_plat_uclass(struct unit_test_state *uts)
{
struct udevice *bus;
struct driver *drv;
@@ -456,28 +456,28 @@
/* 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;
+ size = drv->per_child_plat_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 = size;
- drv->per_child_platdata_auto = 0;
- ret = test_bus_parent_platdata(uts);
+ bus->uclass->uc_drv->per_child_plat_auto = size;
+ drv->per_child_plat_auto = 0;
+ ret = test_bus_parent_plat(uts);
if (ret)
return ret;
- bus->uclass->uc_drv->per_child_platdata_auto = 0;
- drv->per_child_platdata_auto = size;
+ bus->uclass->uc_drv->per_child_plat_auto = 0;
+ drv->per_child_plat_auto = size;
return 0;
}
-DM_TEST(dm_test_bus_parent_platdata_uclass,
+DM_TEST(dm_test_bus_parent_plat_uclass,
UT_TESTF_SCAN_PDATA | UT_TESTF_SCAN_FDT);
/* Test that the child post_bind method is called */
static int dm_test_bus_child_post_bind(struct unit_test_state *uts)
{
- struct dm_test_parent_platdata *plat;
+ struct dm_test_parent_plat *plat;
struct udevice *bus, *dev;
ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
@@ -485,7 +485,7 @@
dev;
device_find_next_child(&dev)) {
/* Check that platform data is allocated */
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
ut_assert(plat != NULL);
ut_asserteq(1, plat->bind_flag);
}
@@ -498,7 +498,7 @@
/* Test that the child post_bind method is called */
static int dm_test_bus_child_post_bind_uclass(struct unit_test_state *uts)
{
- struct dm_test_parent_platdata *plat;
+ struct dm_test_parent_plat *plat;
struct udevice *bus, *dev;
ut_assertok(uclass_get_device(UCLASS_TEST_BUS, 0, &bus));
@@ -506,7 +506,7 @@
dev;
device_find_next_child(&dev)) {
/* Check that platform data is allocated */
- plat = dev_get_parent_platdata(dev);
+ plat = dev_get_parent_plat(dev);
ut_assert(plat != NULL);
ut_asserteq(2, plat->uclass_bind_flag);
}
diff --git a/test/dm/core.c b/test/dm/core.c
index c3e8922..617458f 100644
--- a/test/dm/core.c
+++ b/test/dm/core.c
@@ -45,27 +45,27 @@
U_BOOT_DEVICE(dm_test_info1) = {
.name = "test_drv",
- .platdata = &test_pdata[0],
+ .plat = &test_pdata[0],
};
U_BOOT_DEVICE(dm_test_info2) = {
.name = "test_drv",
- .platdata = &test_pdata[1],
+ .plat = &test_pdata[1],
};
U_BOOT_DEVICE(dm_test_info3) = {
.name = "test_drv",
- .platdata = &test_pdata[2],
+ .plat = &test_pdata[2],
};
static struct driver_info driver_info_manual = {
.name = "test_manual_drv",
- .platdata = &test_pdata_manual,
+ .plat = &test_pdata_manual,
};
static struct driver_info driver_info_pre_reloc = {
.name = "test_pre_reloc_drv",
- .platdata = &test_pdata_pre_reloc,
+ .plat = &test_pdata_pre_reloc,
};
static struct driver_info driver_info_act_dma = {
@@ -105,7 +105,7 @@
return 0;
}
-/* Test that binding with platdata occurs correctly */
+/* Test that binding with plat occurs correctly */
static int dm_test_autobind(struct unit_test_state *uts)
{
struct dm_test_state *dms = uts->priv;
@@ -140,7 +140,7 @@
}
DM_TEST(dm_test_autobind, 0);
-/* Test that binding with uclass platdata allocation occurs correctly */
+/* Test that binding with uclass plat allocation occurs correctly */
static int dm_test_autobind_uclass_pdata_alloc(struct unit_test_state *uts)
{
struct dm_test_perdev_uc_pdata *uc_pdata;
@@ -152,16 +152,16 @@
/**
* Test if test uclass driver requires allocation for the uclass
- * platform data and then check the dev->uclass_platdata pointer.
+ * platform data and then check the dev->uclass_plat pointer.
*/
- ut_assert(uc->uc_drv->per_device_platdata_auto);
+ ut_assert(uc->uc_drv->per_device_plat_auto);
for (uclass_find_first_device(UCLASS_TEST, &dev);
dev;
uclass_find_next_device(&dev)) {
ut_assertnonnull(dev);
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
}
@@ -169,7 +169,7 @@
}
DM_TEST(dm_test_autobind_uclass_pdata_alloc, UT_TESTF_SCAN_PDATA);
-/* Test that binding with uclass platdata setting occurs correctly */
+/* Test that binding with uclass plat setting occurs correctly */
static int dm_test_autobind_uclass_pdata_valid(struct unit_test_state *uts)
{
struct dm_test_perdev_uc_pdata *uc_pdata;
@@ -184,7 +184,7 @@
uclass_find_next_device(&dev)) {
ut_assertnonnull(dev);
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
ut_assert(uc_pdata->intval1 == TEST_UC_PDATA_INTVAL1);
ut_assert(uc_pdata->intval2 == TEST_UC_PDATA_INTVAL2);
@@ -255,7 +255,7 @@
ut_assert(priv);
ut_asserteq(expected_base_add, priv->base_add);
- pdata = dev->platdata;
+ pdata = dev->plat;
expected_base_add += pdata->ping_add;
}
@@ -263,7 +263,7 @@
}
DM_TEST(dm_test_autoprobe, UT_TESTF_SCAN_PDATA);
-/* Check that we see the correct platdata in each device */
+/* Check that we see the correct plat in each device */
static int dm_test_platdata(struct unit_test_state *uts)
{
const struct dm_test_pdata *pdata;
@@ -273,7 +273,7 @@
for (i = 0; i < 3; i++) {
ut_assertok(uclass_find_device(UCLASS_TEST, i, &dev));
ut_assert(dev);
- pdata = dev->platdata;
+ pdata = dev->plat;
ut_assert(pdata->ping_add == test_pdata[i].ping_add);
}
@@ -400,10 +400,10 @@
int expected;
int pingret;
- /* Getting the child device should allocate platdata / priv */
+ /* Getting the child device should allocate plat / priv */
ut_assertok(testfdt_ping(dev, 10, &pingret));
ut_assert(dev->priv);
- ut_assert(dev->platdata);
+ ut_assert(dev->plat);
expected = 10 + base;
ut_asserteq(expected, pingret);
@@ -438,7 +438,7 @@
/*
* Get the 'reg' property, which tells us what the ping add
- * should be. We don't use the platdata because we want
+ * should be. We don't use the plat because we want
* to test the code that sets that up (testfdt_drv_probe()).
*/
base = test_pdata[i].ping_add;
@@ -547,7 +547,7 @@
&driver_info_manual, &dev));
pdata = calloc(1, sizeof(*pdata));
pdata->ping_add = key + i;
- dev->platdata = pdata;
+ dev->plat = pdata;
if (child)
child[i] = dev;
}
diff --git a/test/dm/devres.c b/test/dm/devres.c
index e1e088a..00edbd0 100644
--- a/test/dm/devres.c
+++ b/test/dm/devres.c
@@ -158,7 +158,7 @@
ut_asserteq(1, stats.allocs);
ut_asserteq(TEST_DEVRES_SIZE, stats.total_size);
- /* Getting platdata should add one allocation */
+ /* Getting plat should add one allocation */
ut_assertok(device_ofdata_to_platdata(dev));
devres_get_stats(dev, &stats);
ut_asserteq(2, stats.allocs);
diff --git a/test/dm/gpio.c b/test/dm/gpio.c
index 54e960b..d7b85e7 100644
--- a/test/dm/gpio.c
+++ b/test/dm/gpio.c
@@ -30,7 +30,7 @@
/*
* We expect to get 4 banks. One is anonymous (just numbered) and
- * comes from platdata. The other are named a (20 gpios),
+ * comes from plat. The other are named a (20 gpios),
* b (10 gpios) and c (10 gpios) and come from the device tree. See
* test/dm/test.dts.
*/
diff --git a/test/dm/ofread.c b/test/dm/ofread.c
index 9064426..8c7dd82 100644
--- a/test/dm/ofread.c
+++ b/test/dm/ofread.c
@@ -33,7 +33,7 @@
ut_asserteq(4, len);
break;
case 3:
- /* only for platdata */
+ /* only for plat */
ut_asserteq_str("name", propname);
ut_asserteq(6, len);
ut_asserteq_str("flash", value);
diff --git a/test/dm/regulator.c b/test/dm/regulator.c
index 0e7a232..86f4862 100644
--- a/test/dm/regulator.c
+++ b/test/dm/regulator.c
@@ -50,7 +50,7 @@
/* Test regulator get method */
static int dm_test_power_regulator_get(struct unit_test_state *uts)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *dev_by_devname;
struct udevice *dev_by_platname;
const char *devname;
@@ -77,7 +77,7 @@
* a device with the name equal to the requested one.
*/
ut_assertok(regulator_get_by_platname(platname, &dev_by_platname));
- uc_pdata = dev_get_uclass_platdata(dev_by_platname);
+ uc_pdata = dev_get_uclass_plat(dev_by_platname);
ut_assert(uc_pdata);
ut_asserteq_str(platname, uc_pdata->name);
@@ -95,7 +95,7 @@
/* Test regulator set and get Voltage method */
static int dm_test_power_regulator_set_get_voltage(struct unit_test_state *uts)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *dev;
const char *platname;
int val_set, val_get;
@@ -104,7 +104,7 @@
platname = regulator_names[BUCK1][PLATNAME];
ut_assertok(regulator_get_by_platname(platname, &dev));
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
val_set = uc_pdata->min_uV;
@@ -122,7 +122,7 @@
/* Test regulator set and get Current method */
static int dm_test_power_regulator_set_get_current(struct unit_test_state *uts)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
struct udevice *dev;
const char *platname;
int val_set, val_get;
@@ -131,7 +131,7 @@
platname = regulator_names[LDO1][PLATNAME];
ut_assertok(regulator_get_by_platname(platname, &dev));
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
val_set = uc_pdata->min_uA;
@@ -146,7 +146,7 @@
platname = regulator_names[LDO2][PLATNAME];
ut_assertok(regulator_get_by_platname(platname, &dev));
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
ut_asserteq(-ENODATA, uc_pdata->min_uA);
ut_asserteq(-ENODATA, uc_pdata->max_uA);
@@ -220,7 +220,7 @@
/* Test regulator set and get suspend Voltage method */
static int dm_test_power_regulator_set_get_suspend_voltage(struct unit_test_state *uts)
{
- struct dm_regulator_uclass_platdata *uc_pdata;
+ struct dm_regulator_uclass_plat *uc_pdata;
const struct dm_regulator_ops *ops;
struct udevice *dev;
const char *platname;
@@ -230,7 +230,7 @@
platname = regulator_names[BUCK1][PLATNAME];
ut_assertok(regulator_get_by_platname(platname, &dev));
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
ops = dev_get_driver_ops(dev);
diff --git a/test/dm/test-fdt.c b/test/dm/test-fdt.c
index 79f39d0..4fb8ea4 100644
--- a/test/dm/test-fdt.c
+++ b/test/dm/test-fdt.c
@@ -25,7 +25,7 @@
static int testfdt_drv_ping(struct udevice *dev, int pingval, int *pingret)
{
- const struct dm_test_pdata *pdata = dev->platdata;
+ const struct dm_test_pdata *pdata = dev->plat;
struct dm_test_priv *priv = dev_get_priv(dev);
*pingret = pingval + pdata->ping_add;
@@ -87,7 +87,7 @@
.probe = testfdt_drv_probe,
.ops = &test_ops,
.priv_auto = sizeof(struct dm_test_priv),
- .platdata_auto = sizeof(struct dm_test_pdata),
+ .plat_auto = sizeof(struct dm_test_pdata),
};
static const struct udevice_id testfdt1_ids[] = {
@@ -105,7 +105,7 @@
.probe = testfdt_drv_probe,
.ops = &test_ops,
.priv_auto = sizeof(struct dm_test_priv),
- .platdata_auto = sizeof(struct dm_test_pdata),
+ .plat_auto = sizeof(struct dm_test_pdata),
.flags = DM_FLAG_PRE_RELOC,
};
@@ -147,7 +147,7 @@
.of_match = testprobe_ids,
.id = UCLASS_TEST_PROBE,
.probe = testprobe_drv_probe,
- .platdata_auto = sizeof(struct dm_testprobe_pdata),
+ .plat_auto = sizeof(struct dm_testprobe_pdata),
};
UCLASS_DRIVER(testprobe) = {
@@ -204,7 +204,7 @@
.bind = testdevres_drv_bind,
.ofdata_to_platdata = testdevres_drv_ofdata_to_platdata,
.probe = testdevres_drv_probe,
- .platdata_auto = sizeof(struct dm_testdevres_pdata),
+ .plat_auto = sizeof(struct dm_testdevres_pdata),
.priv_auto = sizeof(struct dm_testdevres_priv),
};
@@ -232,7 +232,7 @@
/*
* Get the 'ping-expect' property, which tells us what the
- * ping add should be. We don't use the platdata because we
+ * ping add should be. We don't use the plat because we
* want to test the code that sets that up
* (testfdt_drv_probe()).
*/
@@ -271,7 +271,7 @@
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->plat);
}
ut_assertok(dm_check_devices(uts, num_devices));
diff --git a/test/dm/test-uclass.c b/test/dm/test-uclass.c
index 94c2753..378fc1e 100644
--- a/test/dm/test-uclass.c
+++ b/test/dm/test-uclass.c
@@ -36,7 +36,7 @@
dm_testdrv_op_count[DM_TEST_OP_POST_BIND]++;
ut_assert(!device_active(dev));
- uc_pdata = dev_get_uclass_platdata(dev);
+ uc_pdata = dev_get_uclass_plat(dev);
ut_assert(uc_pdata);
uc_pdata->intval1 = TEST_UC_PDATA_INTVAL1;
@@ -82,7 +82,7 @@
if (&prev->uclass_node != &uc->dev_head) {
struct dm_test_uclass_perdev_priv *prev_uc_priv
= dev_get_uclass_priv(prev);
- struct dm_test_pdata *pdata = prev->platdata;
+ struct dm_test_pdata *pdata = prev->plat;
ut_assert(pdata);
ut_assert(prev_uc_priv);
@@ -126,6 +126,6 @@
.destroy = test_destroy,
.priv_auto = sizeof(struct dm_test_uclass_priv),
.per_device_auto = sizeof(struct dm_test_uclass_perdev_priv),
- .per_device_platdata_auto =
+ .per_device_plat_auto =
sizeof(struct dm_test_perdev_uc_pdata),
};