[PATCH v7 3/3] mmc: sdhci-esdhc-imx: remove redundant mx25 handling and consolidate soc data

From: Adrián García Casado

Date: Thu Mar 19 2026 - 14:30:46 EST


Remove the is_imx25_esdhc check and redundant mx25-specific handling as it's no longer necessary since the new_soc initialization. Consolidate the drive data structs for imx25/35.

Signed-off-by: Adrián García Casado <adriangarciacasado42@xxxxxxxxx>
---
drivers/mmc/host/sdhci-esdhc-imx.c | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)

diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index a7a5df673b0f6..3dc43f1e517aa 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -256,11 +256,7 @@ struct esdhc_soc_data {
u32 quirks;
};

-static const struct esdhc_soc_data esdhc_imx25_data = {
- .flags = ESDHC_FLAG_ERR004536,
-};
-
-static const struct esdhc_soc_data esdhc_imx35_data = {
+static const struct esdhc_soc_data esdhc_imx25_35_data = {
.flags = ESDHC_FLAG_ERR004536,
};

@@ -391,8 +387,8 @@ struct pltfm_imx_data {
};

static const struct of_device_id imx_esdhc_dt_ids[] = {
- { .compatible = "fsl,imx25-esdhc", .data = &esdhc_imx25_data, },
- { .compatible = "fsl,imx35-esdhc", .data = &esdhc_imx35_data, },
+ { .compatible = "fsl,imx25-esdhc", .data = &esdhc_imx25_35_data, },
+ { .compatible = "fsl,imx35-esdhc", .data = &esdhc_imx25_35_data, },
{ .compatible = "fsl,imx51-esdhc", .data = &esdhc_imx51_data, },
{ .compatible = "fsl,imx53-esdhc", .data = &esdhc_imx53_data, },
{ .compatible = "fsl,imx6sx-usdhc", .data = &usdhc_imx6sx_data, },
@@ -412,10 +408,6 @@ static const struct of_device_id imx_esdhc_dt_ids[] = {
};
MODULE_DEVICE_TABLE(of, imx_esdhc_dt_ids);

-static inline int is_imx25_esdhc(struct pltfm_imx_data *data)
-{
- return data->socdata == &esdhc_imx25_data;
-}

static inline int is_imx53_esdhc(struct pltfm_imx_data *data)
{
@@ -873,11 +865,8 @@ static void esdhc_writeb_le(struct sdhci_host *host, u8 val, int reg)
new_val = val & SDHCI_CTRL_LED;
/* ensure the endianness */
new_val |= ESDHC_HOST_CONTROL_LE;
- /* bits 8&9 are reserved on mx25 */
- if (!is_imx25_esdhc(imx_data)) {
- /* DMA mode bits are shifted */
- new_val |= (val & SDHCI_CTRL_DMA_MASK) << 5;
- }
+ /* DMA mode bits are shifted */
+ new_val |= (val & SDHCI_CTRL_DMA_MASK) << 5;

/*
* Do not touch buswidth bits here. This is done in
--
2.47.3