diff options
| author | Shawn Lin <shawn.lin@rock-chips.com> | 2026-01-06 05:16:57 +0300 |
|---|---|---|
| committer | Ulf Hansson <ulf.hansson@linaro.org> | 2026-02-23 14:06:54 +0300 |
| commit | d917f35c33fd0abe49f5a93a85489d96b8a9af3b (patch) | |
| tree | 7bc8b7a5b0f28ee9bffcada7e73bb4fa768f4ed0 | |
| parent | cea6e1a151bf4e97f76620441d56e97ef38a2dbd (diff) | |
| download | linux-d917f35c33fd0abe49f5a93a85489d96b8a9af3b.tar.xz | |
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 <shawn.lin@rock-chips.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
| -rw-r--r-- | drivers/mmc/host/dw_mmc.c | 16 | ||||
| -rw-r--r-- | drivers/mmc/host/dw_mmc.h | 6 |
2 files changed, 12 insertions, 10 deletions
diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c index d917b30598c5..4a0b9a6b45f1 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 47775dd8f6a3..3cac7ce7c070 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 */ |
