]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mmc: dw_mmc: Move rstc from struct dw_mci_board to struct dw_mci
authorShawn Lin <shawn.lin@rock-chips.com>
Tue, 6 Jan 2026 02:16:57 +0000 (10:16 +0800)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 23 Feb 2026 11:06:54 +0000 (12:06 +0100)
Nobody using dw_mci_board passes in rstc, move it to the common struct
dw_mci needed by all users.

Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/dw_mmc.c
drivers/mmc/host/dw_mmc.h

index d917b30598c525e2690da8712dd659952d90dc00..4a0b9a6b45f1da291c22efdeb18b4a3a9e79c542 100644 (file)
@@ -3166,9 +3166,9 @@ static struct dw_mci_board *dw_mci_parse_dt(struct dw_mci *host)
                return ERR_PTR(-ENOMEM);
 
        /* find reset controller when exist */
-       pdata->rstc = devm_reset_control_get_optional_exclusive(dev, "reset");
-       if (IS_ERR(pdata->rstc))
-               return ERR_CAST(pdata->rstc);
+       host->rstc = devm_reset_control_get_optional_exclusive(dev, "reset");
+       if (IS_ERR(host->rstc))
+               return ERR_CAST(host->rstc);
 
        if (device_property_read_u32(dev, "fifo-depth", &pdata->fifo_depth))
                dev_info(dev,
@@ -3299,10 +3299,10 @@ int dw_mci_probe(struct dw_mci *host)
                goto err_clk_ciu;
        }
 
-       if (host->pdata->rstc) {
-               reset_control_assert(host->pdata->rstc);
+       if (host->rstc) {
+               reset_control_assert(host->rstc);
                usleep_range(10, 50);
-               reset_control_deassert(host->pdata->rstc);
+               reset_control_deassert(host->rstc);
        }
 
        if (drv_data && drv_data->init) {
@@ -3443,7 +3443,7 @@ err_dmaunmap:
        if (host->use_dma && host->dma_ops->exit)
                host->dma_ops->exit(host);
 
-       reset_control_assert(host->pdata->rstc);
+       reset_control_assert(host->rstc);
 
 err_clk_ciu:
        clk_disable_unprepare(host->ciu_clk);
@@ -3470,7 +3470,7 @@ void dw_mci_remove(struct dw_mci *host)
        if (host->use_dma && host->dma_ops->exit)
                host->dma_ops->exit(host);
 
-       reset_control_assert(host->pdata->rstc);
+       reset_control_assert(host->rstc);
 
        clk_disable_unprepare(host->ciu_clk);
        clk_disable_unprepare(host->biu_clk);
index 47775dd8f6a35cd597a9ed1992e2375bd43555ea..3cac7ce7c0706e4bbef181849234c84bab6a16bf 100644 (file)
@@ -130,6 +130,8 @@ struct dw_mci_dma_slave {
  * @ctype: Card type for this host.
  * @clock: Clock rate configured by set_ios(). Protected by host->lock.
  * @clk_old: The last clock value that was requested from core.
+ * @pdev: platform_device registered
+ * @rstc: Reset controller for this host.
  *
  * Locking
  * =======
@@ -249,6 +251,8 @@ struct dw_mci {
        u32                     ctype;
        unsigned int            clock;
        unsigned int            clk_old;
+       struct platform_device  *pdev;
+       struct reset_control *rstc;
 };
 
 /* DMA ops for Internal/External DMAC interface */
@@ -276,8 +280,6 @@ struct dw_mci_board {
 
        /* delay in mS before detecting cards after interrupt */
        u32 detect_delay_ms;
-
-       struct reset_control *rstc;
 };
 
 /* Support for longer data read timeout */