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/spi/cadence_qspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/spi/cadence_qspi.c') diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index 1e857492090..dcee7b77033 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -354,8 +354,8 @@ U_BOOT_DRIVER(cadence_spi) = { .of_match = cadence_spi_ids, .ops = &cadence_spi_ops, .ofdata_to_platdata = cadence_spi_ofdata_to_platdata, - .platdata_auto_alloc_size = sizeof(struct cadence_spi_platdata), - .priv_auto_alloc_size = sizeof(struct cadence_spi_priv), + .platdata_auto = sizeof(struct cadence_spi_platdata), + .priv_auto = sizeof(struct cadence_spi_priv), .probe = cadence_spi_probe, .remove = cadence_spi_remove, .flags = DM_FLAG_OS_PREPARE, -- 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/spi/cadence_qspi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/spi/cadence_qspi.c') diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index dcee7b77033..f097fc17a57 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -27,7 +27,7 @@ static int cadence_spi_write_speed(struct udevice *bus, uint hz) { - struct cadence_spi_platdata *plat = bus->platdata; + struct cadence_spi_platdata *plat = bus->plat; struct cadence_spi_priv *priv = dev_get_priv(bus); cadence_qspi_apb_config_baudrate_div(priv->regbase, @@ -130,7 +130,7 @@ static int spi_calibration(struct udevice *bus, uint hz) static int cadence_spi_set_speed(struct udevice *bus, uint hz) { - struct cadence_spi_platdata *plat = bus->platdata; + struct cadence_spi_platdata *plat = bus->plat; struct cadence_spi_priv *priv = dev_get_priv(bus); int err; @@ -165,7 +165,7 @@ static int cadence_spi_set_speed(struct udevice *bus, uint hz) static int cadence_spi_probe(struct udevice *bus) { - struct cadence_spi_platdata *plat = bus->platdata; + struct cadence_spi_platdata *plat = bus->plat; struct cadence_spi_priv *priv = dev_get_priv(bus); struct clk clk; int ret; @@ -212,7 +212,7 @@ static int cadence_spi_remove(struct udevice *dev) static int cadence_spi_set_mode(struct udevice *bus, uint mode) { - struct cadence_spi_platdata *plat = bus->platdata; + struct cadence_spi_platdata *plat = bus->plat; struct cadence_spi_priv *priv = dev_get_priv(bus); /* Disable QSPI */ @@ -235,7 +235,7 @@ static int cadence_spi_mem_exec_op(struct spi_slave *spi, const struct spi_mem_op *op) { struct udevice *bus = spi->dev->parent; - struct cadence_spi_platdata *plat = bus->platdata; + struct cadence_spi_platdata *plat = bus->plat; struct cadence_spi_priv *priv = dev_get_priv(bus); void *base = priv->regbase; int err = 0; @@ -284,7 +284,7 @@ static int cadence_spi_mem_exec_op(struct spi_slave *spi, static int cadence_spi_ofdata_to_platdata(struct udevice *bus) { - struct cadence_spi_platdata *plat = bus->platdata; + struct cadence_spi_platdata *plat = bus->plat; ofnode subnode; plat->regbase = (void *)devfdt_get_addr_index(bus, 0); @@ -354,7 +354,7 @@ U_BOOT_DRIVER(cadence_spi) = { .of_match = cadence_spi_ids, .ops = &cadence_spi_ops, .ofdata_to_platdata = cadence_spi_ofdata_to_platdata, - .platdata_auto = sizeof(struct cadence_spi_platdata), + .plat_auto = sizeof(struct cadence_spi_platdata), .priv_auto = sizeof(struct cadence_spi_priv), .probe = cadence_spi_probe, .remove = cadence_spi_remove, -- 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/spi/cadence_qspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/spi/cadence_qspi.c') diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index f097fc17a57..2317d365596 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -282,7 +282,7 @@ static int cadence_spi_mem_exec_op(struct spi_slave *spi, return err; } -static int cadence_spi_ofdata_to_platdata(struct udevice *bus) +static int cadence_spi_of_to_plat(struct udevice *bus) { struct cadence_spi_platdata *plat = bus->plat; ofnode subnode; @@ -353,7 +353,7 @@ U_BOOT_DRIVER(cadence_spi) = { .id = UCLASS_SPI, .of_match = cadence_spi_ids, .ops = &cadence_spi_ops, - .ofdata_to_platdata = cadence_spi_ofdata_to_platdata, + .of_to_plat = cadence_spi_of_to_plat, .plat_auto = sizeof(struct cadence_spi_platdata), .priv_auto = sizeof(struct cadence_spi_priv), .probe = cadence_spi_probe, -- cgit v1.2.3 From 8a8d24bdf174851ebb8607f359d54b72e3283b97 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 3 Dec 2020 16:55:23 -0700 Subject: dm: treewide: Rename ..._platdata variables to just ..._plat Try to maintain some consistency between these variables by using _plat as a suffix for them. Signed-off-by: Simon Glass --- drivers/spi/cadence_qspi.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'drivers/spi/cadence_qspi.c') diff --git a/drivers/spi/cadence_qspi.c b/drivers/spi/cadence_qspi.c index 2317d365596..b746501f5ff 100644 --- a/drivers/spi/cadence_qspi.c +++ b/drivers/spi/cadence_qspi.c @@ -27,7 +27,7 @@ static int cadence_spi_write_speed(struct udevice *bus, uint hz) { - struct cadence_spi_platdata *plat = bus->plat; + struct cadence_spi_plat *plat = bus->plat; struct cadence_spi_priv *priv = dev_get_priv(bus); cadence_qspi_apb_config_baudrate_div(priv->regbase, @@ -130,7 +130,7 @@ static int spi_calibration(struct udevice *bus, uint hz) static int cadence_spi_set_speed(struct udevice *bus, uint hz) { - struct cadence_spi_platdata *plat = bus->plat; + struct cadence_spi_plat *plat = bus->plat; struct cadence_spi_priv *priv = dev_get_priv(bus); int err; @@ -165,7 +165,7 @@ static int cadence_spi_set_speed(struct udevice *bus, uint hz) static int cadence_spi_probe(struct udevice *bus) { - struct cadence_spi_platdata *plat = bus->plat; + struct cadence_spi_plat *plat = bus->plat; struct cadence_spi_priv *priv = dev_get_priv(bus); struct clk clk; int ret; @@ -212,7 +212,7 @@ static int cadence_spi_remove(struct udevice *dev) static int cadence_spi_set_mode(struct udevice *bus, uint mode) { - struct cadence_spi_platdata *plat = bus->plat; + struct cadence_spi_plat *plat = bus->plat; struct cadence_spi_priv *priv = dev_get_priv(bus); /* Disable QSPI */ @@ -235,7 +235,7 @@ static int cadence_spi_mem_exec_op(struct spi_slave *spi, const struct spi_mem_op *op) { struct udevice *bus = spi->dev->parent; - struct cadence_spi_platdata *plat = bus->plat; + struct cadence_spi_plat *plat = bus->plat; struct cadence_spi_priv *priv = dev_get_priv(bus); void *base = priv->regbase; int err = 0; @@ -284,7 +284,7 @@ static int cadence_spi_mem_exec_op(struct spi_slave *spi, static int cadence_spi_of_to_plat(struct udevice *bus) { - struct cadence_spi_platdata *plat = bus->plat; + struct cadence_spi_plat *plat = bus->plat; ofnode subnode; plat->regbase = (void *)devfdt_get_addr_index(bus, 0); @@ -354,7 +354,7 @@ U_BOOT_DRIVER(cadence_spi) = { .of_match = cadence_spi_ids, .ops = &cadence_spi_ops, .of_to_plat = cadence_spi_of_to_plat, - .plat_auto = sizeof(struct cadence_spi_platdata), + .plat_auto = sizeof(struct cadence_spi_plat), .priv_auto = sizeof(struct cadence_spi_priv), .probe = cadence_spi_probe, .remove = cadence_spi_remove, -- cgit v1.2.3