[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240827074857.2671808-3-xirui.zhang@vivo.com>
Date: Tue, 27 Aug 2024 01:48:40 -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>,
Bartosz Golaszewski <bartosz.golaszewski@...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 2/9] mmc: davinci_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/davinci_mmc.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c
index 9cbde800685d..3e71565285c3 100644
--- a/drivers/mmc/host/davinci_mmc.c
+++ b/drivers/mmc/host/davinci_mmc.c
@@ -1218,14 +1218,11 @@ static int davinci_mmcsd_probe(struct platform_device *pdev)
goto ioremap_fail;
}
- host->clk = devm_clk_get(&pdev->dev, NULL);
+ host->clk = devm_clk_get_enabled(&pdev->dev, NULL);
if (IS_ERR(host->clk)) {
ret = PTR_ERR(host->clk);
goto clk_get_fail;
}
- ret = clk_prepare_enable(host->clk);
- if (ret)
- goto clk_prepare_enable_fail;
host->mmc_input_clk = clk_get_rate(host->clk);
@@ -1336,8 +1333,6 @@ static int davinci_mmcsd_probe(struct platform_device *pdev)
davinci_release_dma_channels(host);
parse_fail:
dma_probe_defer:
- clk_disable_unprepare(host->clk);
-clk_prepare_enable_fail:
clk_get_fail:
ioremap_fail:
mmc_free_host(mmc);
@@ -1352,7 +1347,6 @@ static void davinci_mmcsd_remove(struct platform_device *pdev)
mmc_remove_host(host->mmc);
mmc_davinci_cpufreq_deregister(host);
davinci_release_dma_channels(host);
- clk_disable_unprepare(host->clk);
mmc_free_host(host->mmc);
}
--
2.25.1
Powered by blists - more mailing lists