[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240827074857.2671808-7-xirui.zhang@vivo.com>
Date: Tue, 27 Aug 2024 01:48:44 -0600
From: zhangxirui <xirui.zhang@...o.com>
To: Robert Richter <rric@...nel.org>,
Ulf Hansson <ulf.hansson@...aro.org>,
Jaehoon Chung <jh80.chung@...sung.com>,
Nicolas Pitre <nico@...xnic.net>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Taichi Sugaya <sugaya.taichi@...ionext.com>,
Takao Orito <orito.takao@...ionext.com>,
Michal Simek <michal.simek@....com>,
zhangxirui <xirui.zhang@...o.com>,
Bastien Curutchet <bastien.curutchet@...tlin.com>,
Linus Walleij <linus.walleij@...aro.org>,
Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
linux-mmc@...r.kernel.org,
linux-kernel@...r.kernel.org,
imx@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org
Subject: [PATCH 6/9] mmc: mxs-mmc: Use devm_clk_get_enabled() helpers
Use devm_clk_get_enabled() to simplify code
and avoids the calls to clk_disable_unprepare().
Signed-off-by: zhangxirui <xirui.zhang@...o.com>
---
drivers/mmc/host/mxs-mmc.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 6751da9b60f9..591b5a3ad6dd 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -602,19 +602,16 @@ static int mxs_mmc_probe(struct platform_device *pdev)
goto out_mmc_free;
}
- ssp->clk = devm_clk_get(&pdev->dev, NULL);
+ ssp->clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(ssp->clk)) {
ret = PTR_ERR(ssp->clk);
goto out_mmc_free;
}
- ret = clk_prepare_enable(ssp->clk);
- if (ret)
- goto out_mmc_free;
ret = mxs_mmc_reset(host);
if (ret) {
dev_err(&pdev->dev, "Failed to reset mmc: %d\n", ret);
- goto out_clk_disable;
+ goto out_mmc_free;
}
ssp->dmach = dma_request_chan(&pdev->dev, "rx-tx");
@@ -622,7 +619,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
dev_err(mmc_dev(host->mmc),
"%s: failed to request dma\n", __func__);
ret = PTR_ERR(ssp->dmach);
- goto out_clk_disable;
+ goto out_mmc_free;
}
/* set mmc core parameters */
@@ -666,8 +663,6 @@ static int mxs_mmc_probe(struct platform_device *pdev)
out_free_dma:
dma_release_channel(ssp->dmach);
-out_clk_disable:
- clk_disable_unprepare(ssp->clk);
out_mmc_free:
mmc_free_host(mmc);
return ret;
@@ -684,8 +679,6 @@ static void mxs_mmc_remove(struct platform_device *pdev)
if (ssp->dmach)
dma_release_channel(ssp->dmach);
- clk_disable_unprepare(ssp->clk);
-
mmc_free_host(mmc);
}
--
2.25.1
Powered by blists - more mailing lists