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/tegra20_sflash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/spi/tegra20_sflash.c') diff --git a/drivers/spi/tegra20_sflash.c b/drivers/spi/tegra20_sflash.c index 771744dfe43..bc39e8b9aa4 100644 --- a/drivers/spi/tegra20_sflash.c +++ b/drivers/spi/tegra20_sflash.c @@ -354,7 +354,7 @@ U_BOOT_DRIVER(tegra20_sflash) = { .of_match = tegra20_sflash_ids, .ops = &tegra20_sflash_ops, .ofdata_to_platdata = tegra20_sflash_ofdata_to_platdata, - .platdata_auto_alloc_size = sizeof(struct tegra_spi_platdata), - .priv_auto_alloc_size = sizeof(struct tegra20_sflash_priv), + .platdata_auto = sizeof(struct tegra_spi_platdata), + .priv_auto = sizeof(struct tegra20_sflash_priv), .probe = tegra20_sflash_probe, }; -- 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/tegra20_sflash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/spi/tegra20_sflash.c') diff --git a/drivers/spi/tegra20_sflash.c b/drivers/spi/tegra20_sflash.c index bc39e8b9aa4..f2d2701d3a7 100644 --- a/drivers/spi/tegra20_sflash.c +++ b/drivers/spi/tegra20_sflash.c @@ -89,7 +89,7 @@ int tegra20_sflash_cs_info(struct udevice *bus, unsigned int cs, static int tegra20_sflash_ofdata_to_platdata(struct udevice *bus) { - struct tegra_spi_platdata *plat = bus->platdata; + struct tegra_spi_platdata *plat = bus->plat; const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); @@ -314,7 +314,7 @@ static int tegra20_sflash_xfer(struct udevice *dev, unsigned int bitlen, static int tegra20_sflash_set_speed(struct udevice *bus, uint speed) { - struct tegra_spi_platdata *plat = bus->platdata; + struct tegra_spi_platdata *plat = bus->plat; struct tegra20_sflash_priv *priv = dev_get_priv(bus); if (speed > plat->frequency) @@ -354,7 +354,7 @@ U_BOOT_DRIVER(tegra20_sflash) = { .of_match = tegra20_sflash_ids, .ops = &tegra20_sflash_ops, .ofdata_to_platdata = tegra20_sflash_ofdata_to_platdata, - .platdata_auto = sizeof(struct tegra_spi_platdata), + .plat_auto = sizeof(struct tegra_spi_platdata), .priv_auto = sizeof(struct tegra20_sflash_priv), .probe = tegra20_sflash_probe, }; -- 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/spi/tegra20_sflash.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/spi/tegra20_sflash.c') diff --git a/drivers/spi/tegra20_sflash.c b/drivers/spi/tegra20_sflash.c index f2d2701d3a7..53719c7774f 100644 --- a/drivers/spi/tegra20_sflash.c +++ b/drivers/spi/tegra20_sflash.c @@ -116,7 +116,7 @@ static int tegra20_sflash_ofdata_to_platdata(struct udevice *bus) static int tegra20_sflash_probe(struct udevice *bus) { - struct tegra_spi_platdata *plat = dev_get_platdata(bus); + struct tegra_spi_platdata *plat = dev_get_plat(bus); struct tegra20_sflash_priv *priv = dev_get_priv(bus); priv->regs = (struct spi_regs *)plat->base; @@ -173,7 +173,7 @@ static int tegra20_sflash_claim_bus(struct udevice *dev) static void spi_cs_activate(struct udevice *dev) { struct udevice *bus = dev->parent; - struct tegra_spi_platdata *pdata = dev_get_platdata(bus); + struct tegra_spi_platdata *pdata = dev_get_plat(bus); struct tegra20_sflash_priv *priv = dev_get_priv(bus); /* If it's too soon to do another transaction, wait */ @@ -192,7 +192,7 @@ static void spi_cs_activate(struct udevice *dev) static void spi_cs_deactivate(struct udevice *dev) { struct udevice *bus = dev->parent; - struct tegra_spi_platdata *pdata = dev_get_platdata(bus); + struct tegra_spi_platdata *pdata = dev_get_plat(bus); struct tegra20_sflash_priv *priv = dev_get_priv(bus); /* CS is negated on Tegra, so drive a 0 to get a 1 */ -- 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/tegra20_sflash.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/spi/tegra20_sflash.c') diff --git a/drivers/spi/tegra20_sflash.c b/drivers/spi/tegra20_sflash.c index 53719c7774f..d27f67932a4 100644 --- a/drivers/spi/tegra20_sflash.c +++ b/drivers/spi/tegra20_sflash.c @@ -87,7 +87,7 @@ int tegra20_sflash_cs_info(struct udevice *bus, unsigned int cs, return 0; } -static int tegra20_sflash_ofdata_to_platdata(struct udevice *bus) +static int tegra20_sflash_of_to_plat(struct udevice *bus) { struct tegra_spi_platdata *plat = bus->plat; const void *blob = gd->fdt_blob; @@ -353,7 +353,7 @@ U_BOOT_DRIVER(tegra20_sflash) = { .id = UCLASS_SPI, .of_match = tegra20_sflash_ids, .ops = &tegra20_sflash_ops, - .ofdata_to_platdata = tegra20_sflash_ofdata_to_platdata, + .of_to_plat = tegra20_sflash_of_to_plat, .plat_auto = sizeof(struct tegra_spi_platdata), .priv_auto = sizeof(struct tegra20_sflash_priv), .probe = tegra20_sflash_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/tegra20_sflash.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/spi/tegra20_sflash.c') diff --git a/drivers/spi/tegra20_sflash.c b/drivers/spi/tegra20_sflash.c index d27f67932a4..ad19a4efbb7 100644 --- a/drivers/spi/tegra20_sflash.c +++ b/drivers/spi/tegra20_sflash.c @@ -89,7 +89,7 @@ int tegra20_sflash_cs_info(struct udevice *bus, unsigned int cs, static int tegra20_sflash_of_to_plat(struct udevice *bus) { - struct tegra_spi_platdata *plat = bus->plat; + struct tegra_spi_plat *plat = bus->plat; const void *blob = gd->fdt_blob; int node = dev_of_offset(bus); @@ -116,7 +116,7 @@ static int tegra20_sflash_of_to_plat(struct udevice *bus) static int tegra20_sflash_probe(struct udevice *bus) { - struct tegra_spi_platdata *plat = dev_get_plat(bus); + struct tegra_spi_plat *plat = dev_get_plat(bus); struct tegra20_sflash_priv *priv = dev_get_priv(bus); priv->regs = (struct spi_regs *)plat->base; @@ -173,7 +173,7 @@ static int tegra20_sflash_claim_bus(struct udevice *dev) static void spi_cs_activate(struct udevice *dev) { struct udevice *bus = dev->parent; - struct tegra_spi_platdata *pdata = dev_get_plat(bus); + struct tegra_spi_plat *pdata = dev_get_plat(bus); struct tegra20_sflash_priv *priv = dev_get_priv(bus); /* If it's too soon to do another transaction, wait */ @@ -192,7 +192,7 @@ static void spi_cs_activate(struct udevice *dev) static void spi_cs_deactivate(struct udevice *dev) { struct udevice *bus = dev->parent; - struct tegra_spi_platdata *pdata = dev_get_plat(bus); + struct tegra_spi_plat *pdata = dev_get_plat(bus); struct tegra20_sflash_priv *priv = dev_get_priv(bus); /* CS is negated on Tegra, so drive a 0 to get a 1 */ @@ -314,7 +314,7 @@ static int tegra20_sflash_xfer(struct udevice *dev, unsigned int bitlen, static int tegra20_sflash_set_speed(struct udevice *bus, uint speed) { - struct tegra_spi_platdata *plat = bus->plat; + struct tegra_spi_plat *plat = bus->plat; struct tegra20_sflash_priv *priv = dev_get_priv(bus); if (speed > plat->frequency) @@ -354,7 +354,7 @@ U_BOOT_DRIVER(tegra20_sflash) = { .of_match = tegra20_sflash_ids, .ops = &tegra20_sflash_ops, .of_to_plat = tegra20_sflash_of_to_plat, - .plat_auto = sizeof(struct tegra_spi_platdata), + .plat_auto = sizeof(struct tegra_spi_plat), .priv_auto = sizeof(struct tegra20_sflash_priv), .probe = tegra20_sflash_probe, }; -- cgit v1.2.3