[PATCH v2 2/3] drivers: avoid using aliases on drivers when OF_PLATDATA is enabled
Walter Lozano
walter.lozano at collabora.com
Thu Jul 23 05:22:04 CEST 2020
After latest improvements on OF_PLATDATA struct names are generated
based on driver name instead of compatible strings. With this in mind,
using aliases in drivers are not longer needed.
This patch removes code that tried to handle these kind of aliases to
improve readability.
Signed-off-by: Walter Lozano <walter.lozano at collabora.com>
---
Changes in v2:
- Remove aliases from drivers
drivers/gpio/mxs_gpio.c | 10 ++--------
drivers/mmc/mxsmmc.c | 10 ++--------
drivers/spi/mxs_spi.c | 10 ++--------
3 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/drivers/gpio/mxs_gpio.c b/drivers/gpio/mxs_gpio.c
index cb797261b7..b30adf50da 100644
--- a/drivers/gpio/mxs_gpio.c
+++ b/drivers/gpio/mxs_gpio.c
@@ -138,12 +138,6 @@ int name_to_gpio(const char *name)
#include <asm/arch/gpio.h>
#define MXS_MAX_GPIO_PER_BANK 32
-#ifdef CONFIG_MX28
-#define dtd_fsl_imx_gpio dtd_fsl_imx28_gpio
-#else /* CONFIG_MX23 */
-#define dtd_fsl_imx_gpio dtd_fsl_imx23_gpio
-#endif
-
DECLARE_GLOBAL_DATA_PTR;
/*
* According to i.MX28 Reference Manual:
@@ -158,7 +152,7 @@ DECLARE_GLOBAL_DATA_PTR;
struct mxs_gpio_platdata {
#if CONFIG_IS_ENABLED(OF_PLATDATA)
- struct dtd_fsl_imx_gpio dtplat;
+ struct dtd_fsl_imx23_gpio dtplat;
#endif
unsigned int bank;
int gpio_ranges;
@@ -247,7 +241,7 @@ static int mxs_gpio_probe(struct udevice *dev)
char name[16], *str;
#if CONFIG_IS_ENABLED(OF_PLATDATA)
- struct dtd_fsl_imx_gpio *dtplat = &plat->dtplat;
+ struct dtd_fsl_imx23_gpio *dtplat = &plat->dtplat;
priv->bank = (unsigned int)dtplat->reg[0];
uc_priv->gpio_count = dtplat->gpio_ranges[3];
#else
diff --git a/drivers/mmc/mxsmmc.c b/drivers/mmc/mxsmmc.c
index c6a06b9ca8..c368271c23 100644
--- a/drivers/mmc/mxsmmc.c
+++ b/drivers/mmc/mxsmmc.c
@@ -52,15 +52,9 @@ struct mxsmmc_priv {
#include <dm/read.h>
#include <dt-structs.h>
-#ifdef CONFIG_MX28
-#define dtd_fsl_imx_mmc dtd_fsl_imx28_mmc
-#else /* CONFIG_MX23 */
-#define dtd_fsl_imx_mmc dtd_fsl_imx23_mmc
-#endif
-
struct mxsmmc_platdata {
#if CONFIG_IS_ENABLED(OF_PLATDATA)
- struct dtd_fsl_imx_mmc dtplat;
+ struct dtd_fsl_imx23_mmc dtplat;
#endif
struct mmc_config cfg;
struct mmc mmc;
@@ -581,7 +575,7 @@ static int mxsmmc_probe(struct udevice *dev)
debug("%s: probe\n", __func__);
#if CONFIG_IS_ENABLED(OF_PLATDATA)
- struct dtd_fsl_imx_mmc *dtplat = &plat->dtplat;
+ struct dtd_fsl_imx23_mmc *dtplat = &plat->dtplat;
struct phandle_1_arg *p1a = &dtplat->clocks[0];
priv->buswidth = dtplat->bus_width;
diff --git a/drivers/spi/mxs_spi.c b/drivers/spi/mxs_spi.c
index 3c1af839c0..fb0af02be0 100644
--- a/drivers/spi/mxs_spi.c
+++ b/drivers/spi/mxs_spi.c
@@ -41,15 +41,9 @@
#define MXS_SSP_IMX23_CLKID_SSP0 33
#define MXS_SSP_IMX28_CLKID_SSP0 46
-#ifdef CONFIG_MX28
-#define dtd_fsl_imx_spi dtd_fsl_imx28_spi
-#else /* CONFIG_MX23 */
-#define dtd_fsl_imx_spi dtd_fsl_imx23_spi
-#endif
-
struct mxs_spi_platdata {
#if CONFIG_IS_ENABLED(OF_PLATDATA)
- struct dtd_fsl_imx_spi dtplat;
+ struct dtd_fsl_imx23_spi dtplat;
#endif
s32 frequency; /* Default clock frequency, -1 for none */
fdt_addr_t base; /* SPI IP block base address */
@@ -324,7 +318,7 @@ static int mxs_spi_probe(struct udevice *bus)
debug("%s: probe\n", __func__);
#if CONFIG_IS_ENABLED(OF_PLATDATA)
- struct dtd_fsl_imx_spi *dtplat = &plat->dtplat;
+ struct dtd_fsl_imx23_spi *dtplat = &plat->dtplat;
struct phandle_1_arg *p1a = &dtplat->clocks[0];
priv->regs = (struct mxs_ssp_regs *)dtplat->reg[0];
--
2.20.1
More information about the U-Boot
mailing list