From: Shawn Lin Date: Tue, 6 Jan 2026 02:16:57 +0000 (+0800) Subject: mmc: dw_mmc: Move rstc from struct dw_mci_board to struct dw_mci X-Git-Tag: v7.1-rc1~157^2~88 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d917f35c33fd0abe49f5a93a85489d96b8a9af3b;p=thirdparty%2Fkernel%2Fstable.git mmc: dw_mmc: Move rstc from struct dw_mci_board to struct dw_mci 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 Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index d917b30598c52..4a0b9a6b45f1d 100644 --- a/drivers/mmc/host/dw_mmc.c +++ b/drivers/mmc/host/dw_mmc.c @@ -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); diff --git a/drivers/mmc/host/dw_mmc.h b/drivers/mmc/host/dw_mmc.h index 47775dd8f6a35..3cac7ce7c0706 100644 --- a/drivers/mmc/host/dw_mmc.h +++ b/drivers/mmc/host/dw_mmc.h @@ -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 */