From 41575d8e4c334df148c4cdd7c40cc825dc0fcaa1 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:17 -0700 Subject: 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 --- drivers/demo/demo-shape.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/demo/demo-shape.c') diff --git a/drivers/demo/demo-shape.c b/drivers/demo/demo-shape.c index 8686c998457..0f5cda23dd3 100644 --- a/drivers/demo/demo-shape.c +++ b/drivers/demo/demo-shape.c @@ -193,6 +193,6 @@ U_BOOT_DRIVER(demo_shape_drv) = { .ops = &shape_ops, .probe = dm_shape_probe, .remove = dm_shape_remove, - .priv_auto_alloc_size = sizeof(struct shape_data), - .platdata_auto_alloc_size = sizeof(struct dm_demo_pdata), + .priv_auto = sizeof(struct shape_data), + .platdata_auto = sizeof(struct dm_demo_pdata), }; -- cgit v1.2.3 From caa4daa2ae3dc0a3e516addea5772c9af76abcb0 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:18 -0700 Subject: 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 --- drivers/demo/demo-shape.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/demo/demo-shape.c') diff --git a/drivers/demo/demo-shape.c b/drivers/demo/demo-shape.c index 0f5cda23dd3..cc99f3e8e60 100644 --- a/drivers/demo/demo-shape.c +++ b/drivers/demo/demo-shape.c @@ -194,5 +194,5 @@ U_BOOT_DRIVER(demo_shape_drv) = { .probe = dm_shape_probe, .remove = dm_shape_remove, .priv_auto = sizeof(struct shape_data), - .platdata_auto = sizeof(struct dm_demo_pdata), + .plat_auto = sizeof(struct dm_demo_pdata), }; -- cgit v1.2.3 From c69cda25c9b59e53a6bc8969ada58942549f5b5d Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:20 -0700 Subject: dm: treewide: Rename dev_get_platdata() to dev_get_plat() Rename this to be consistent with the change from 'platdata'. Signed-off-by: Simon Glass --- drivers/demo/demo-shape.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/demo/demo-shape.c') diff --git a/drivers/demo/demo-shape.c b/drivers/demo/demo-shape.c index cc99f3e8e60..b13a4ee4e8a 100644 --- a/drivers/demo/demo-shape.c +++ b/drivers/demo/demo-shape.c @@ -28,7 +28,7 @@ struct shape_data { /* Crazy little function to draw shapes on the console */ static int shape_hello(struct udevice *dev, int ch) { - const struct dm_demo_pdata *pdata = dev_get_platdata(dev); + const struct dm_demo_pdata *pdata = dev_get_plat(dev); struct shape_data *data = dev_get_priv(dev); static const struct shape { int start; @@ -142,7 +142,7 @@ static const struct demo_ops shape_ops = { static int shape_ofdata_to_platdata(struct udevice *dev) { - struct dm_demo_pdata *pdata = dev_get_platdata(dev); + struct dm_demo_pdata *pdata = dev_get_plat(dev); int ret; /* Parse the data that is common with all demo devices */ -- cgit v1.2.3 From d1998a9fde0a917d6496299f6a97b6bccfdc6724 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:21 -0700 Subject: dm: treewide: Rename ofdata_to_platdata() to of_to_plat() This name is far too long. Rename it to remove the 'data' bits. This makes it consistent with the platdata->plat rename. Signed-off-by: Simon Glass --- drivers/demo/demo-shape.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/demo/demo-shape.c') diff --git a/drivers/demo/demo-shape.c b/drivers/demo/demo-shape.c index b13a4ee4e8a..8129317ba1b 100644 --- a/drivers/demo/demo-shape.c +++ b/drivers/demo/demo-shape.c @@ -140,7 +140,7 @@ static const struct demo_ops shape_ops = { .set_light = set_light, }; -static int shape_ofdata_to_platdata(struct udevice *dev) +static int shape_of_to_plat(struct udevice *dev) { struct dm_demo_pdata *pdata = dev_get_plat(dev); int ret; @@ -189,7 +189,7 @@ U_BOOT_DRIVER(demo_shape_drv) = { .name = "demo_shape_drv", .of_match = demo_shape_id, .id = UCLASS_DEMO, - .ofdata_to_platdata = shape_ofdata_to_platdata, + .of_to_plat = shape_of_to_plat, .ops = &shape_ops, .probe = dm_shape_probe, .remove = dm_shape_remove, -- cgit v1.2.3