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/gpio/pca953x_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpio/pca953x_gpio.c') diff --git a/drivers/gpio/pca953x_gpio.c b/drivers/gpio/pca953x_gpio.c index fd17d1a5910..32d4a836131 100644 --- a/drivers/gpio/pca953x_gpio.c +++ b/drivers/gpio/pca953x_gpio.c @@ -385,6 +385,6 @@ U_BOOT_DRIVER(pca953x) = { .id = UCLASS_GPIO, .ops = &pca953x_ops, .probe = pca953x_probe, - .platdata_auto_alloc_size = sizeof(struct pca953x_info), + .platdata_auto = sizeof(struct pca953x_info), .of_match = pca953x_ids, }; -- 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/gpio/pca953x_gpio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/gpio/pca953x_gpio.c') diff --git a/drivers/gpio/pca953x_gpio.c b/drivers/gpio/pca953x_gpio.c index 32d4a836131..239c0f7456b 100644 --- a/drivers/gpio/pca953x_gpio.c +++ b/drivers/gpio/pca953x_gpio.c @@ -385,6 +385,6 @@ U_BOOT_DRIVER(pca953x) = { .id = UCLASS_GPIO, .ops = &pca953x_ops, .probe = pca953x_probe, - .platdata_auto = sizeof(struct pca953x_info), + .plat_auto = sizeof(struct pca953x_info), .of_match = pca953x_ids, }; -- 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/gpio/pca953x_gpio.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers/gpio/pca953x_gpio.c') diff --git a/drivers/gpio/pca953x_gpio.c b/drivers/gpio/pca953x_gpio.c index 239c0f7456b..dc8911a8eb9 100644 --- a/drivers/gpio/pca953x_gpio.c +++ b/drivers/gpio/pca953x_gpio.c @@ -76,7 +76,7 @@ struct pca953x_info { static int pca953x_write_single(struct udevice *dev, int reg, u8 val, int offset) { - struct pca953x_info *info = dev_get_platdata(dev); + struct pca953x_info *info = dev_get_plat(dev); int bank_shift = fls((info->gpio_count - 1) / BANK_SZ); int off = offset / BANK_SZ; int ret = 0; @@ -93,7 +93,7 @@ static int pca953x_write_single(struct udevice *dev, int reg, u8 val, static int pca953x_read_single(struct udevice *dev, int reg, u8 *val, int offset) { - struct pca953x_info *info = dev_get_platdata(dev); + struct pca953x_info *info = dev_get_plat(dev); int bank_shift = fls((info->gpio_count - 1) / BANK_SZ); int off = offset / BANK_SZ; int ret; @@ -112,7 +112,7 @@ static int pca953x_read_single(struct udevice *dev, int reg, u8 *val, static int pca953x_read_regs(struct udevice *dev, int reg, u8 *val) { - struct pca953x_info *info = dev_get_platdata(dev); + struct pca953x_info *info = dev_get_plat(dev); int ret = 0; if (info->gpio_count <= 8) { @@ -137,7 +137,7 @@ static int pca953x_read_regs(struct udevice *dev, int reg, u8 *val) static int pca953x_write_regs(struct udevice *dev, int reg, u8 *val) { - struct pca953x_info *info = dev_get_platdata(dev); + struct pca953x_info *info = dev_get_plat(dev); int ret = 0; if (info->gpio_count <= 8) { @@ -160,7 +160,7 @@ static int pca953x_write_regs(struct udevice *dev, int reg, u8 *val) static int pca953x_is_output(struct udevice *dev, int offset) { - struct pca953x_info *info = dev_get_platdata(dev); + struct pca953x_info *info = dev_get_plat(dev); int bank = offset / BANK_SZ; int off = offset % BANK_SZ; @@ -185,7 +185,7 @@ static int pca953x_get_value(struct udevice *dev, uint offset) static int pca953x_set_value(struct udevice *dev, uint offset, int value) { - struct pca953x_info *info = dev_get_platdata(dev); + struct pca953x_info *info = dev_get_plat(dev); int bank = offset / BANK_SZ; int off = offset % BANK_SZ; u8 val; @@ -207,7 +207,7 @@ static int pca953x_set_value(struct udevice *dev, uint offset, int value) static int pca953x_set_direction(struct udevice *dev, uint offset, int dir) { - struct pca953x_info *info = dev_get_platdata(dev); + struct pca953x_info *info = dev_get_plat(dev); int bank = offset / BANK_SZ; int off = offset % BANK_SZ; u8 val; @@ -271,7 +271,7 @@ static const struct dm_gpio_ops pca953x_ops = { static int pca953x_probe(struct udevice *dev) { - struct pca953x_info *info = dev_get_platdata(dev); + struct pca953x_info *info = dev_get_plat(dev); struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev); char name[32], label[8], *str; int addr; -- cgit v1.2.3