mmc: meson-mx-sdhc: Remove .card_hw_reset callback
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sat, 17 Feb 2024 10:02:00 +0000 (11:02 +0100)
committerUlf Hansson <ulf.hansson@linaro.org>
Tue, 27 Feb 2024 12:39:12 +0000 (13:39 +0100)
Commit 32f18e596141 ("mmc: improve API to make clear hw_reset callback
is for cards") made it clear that the hw_reset callback is intended for
resetting the card. Remove the .card_hw_reset callback from the
meson-mx-sdhc-mmc driver because it's purpose is to reset the SDHC
controller (FIFOs, PHY, DMA interface, ...).

While here also rename and change the argument of meson_mx_sdhc_hw_reset
so it cannot be called by accident as a replacement for card_hw_reset in
the future.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20240217100200.1494980-3-martin.blumenstingl@googlemail.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/meson-mx-sdhc-mmc.c

index 1ed9731e77ef5954a024369dd7706d8bd2e4ee92..31f750301dc1324e230cd485bdcc2d511356a858 100644 (file)
@@ -65,10 +65,8 @@ static const struct regmap_config meson_mx_sdhc_regmap_config = {
        .max_register = MESON_SDHC_CLK2,
 };
 
-static void meson_mx_sdhc_hw_reset(struct mmc_host *mmc)
+static void meson_mx_sdhc_reset(struct meson_mx_sdhc_host *host)
 {
-       struct meson_mx_sdhc_host *host = mmc_priv(mmc);
-
        regmap_write(host->regmap, MESON_SDHC_SRST, MESON_SDHC_SRST_MAIN_CTRL |
                     MESON_SDHC_SRST_RXFIFO | MESON_SDHC_SRST_TXFIFO |
                     MESON_SDHC_SRST_DPHY_RX | MESON_SDHC_SRST_DPHY_TX |
@@ -116,7 +114,7 @@ static void meson_mx_sdhc_wait_cmd_ready(struct mmc_host *mmc)
                dev_warn(mmc_dev(mmc),
                         "Failed to poll for CMD_BUSY while processing CMD%d\n",
                         host->cmd->opcode);
-               meson_mx_sdhc_hw_reset(mmc);
+               meson_mx_sdhc_reset(host);
        }
 
        ret = regmap_read_poll_timeout(host->regmap, MESON_SDHC_ESTA, esta,
@@ -127,7 +125,7 @@ static void meson_mx_sdhc_wait_cmd_ready(struct mmc_host *mmc)
                dev_warn(mmc_dev(mmc),
                         "Failed to poll for ESTA[13:11] while processing CMD%d\n",
                         host->cmd->opcode);
-               meson_mx_sdhc_hw_reset(mmc);
+               meson_mx_sdhc_reset(host);
        }
 }
 
@@ -495,7 +493,6 @@ static int meson_mx_sdhc_execute_tuning(struct mmc_host *mmc, u32 opcode)
 }
 
 static const struct mmc_host_ops meson_mx_sdhc_ops = {
-       .card_hw_reset                  = meson_mx_sdhc_hw_reset,
        .request                        = meson_mx_sdhc_request,
        .set_ios                        = meson_mx_sdhc_set_ios,
        .card_busy                      = meson_mx_sdhc_card_busy,
@@ -618,7 +615,7 @@ static irqreturn_t meson_mx_sdhc_irq_thread(int irq, void *irq_data)
        }
 
        if (cmd->error == -EIO || cmd->error == -ETIMEDOUT)
-               meson_mx_sdhc_hw_reset(host->mmc);
+               meson_mx_sdhc_reset(host);
        else if (cmd->data)
                /*
                 * Clear the FIFOs after completing data transfers to prevent
@@ -728,7 +725,7 @@ static void meson_mx_sdhc_init_hw(struct mmc_host *mmc)
 {
        struct meson_mx_sdhc_host *host = mmc_priv(mmc);
 
-       meson_mx_sdhc_hw_reset(mmc);
+       meson_mx_sdhc_reset(host);
 
        regmap_write(host->regmap, MESON_SDHC_CTRL,
                     FIELD_PREP(MESON_SDHC_CTRL_RX_PERIOD, 0xf) |