[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240820123426.48694-1-rongqianfeng@vivo.com>
Date: Tue, 20 Aug 2024 20:34:26 +0800
From: Rong Qianfeng <rongqianfeng@...o.com>
To: Yong Wu <yong.wu@...iatek.com>,
Krzysztof Kozlowski <krzk@...nel.org>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
linux-mediatek@...ts.infradead.org,
linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org
Cc: opensource.kernel@...o.com,
Rong Qianfeng <rongqianfeng@...o.com>
Subject: [PATCH] memory: mtk-smi: Simplify using devm_clk_get_enabled()
devm_clk_get_enabled() will call devm_clk_get() + clk_prepare_enable()
and the clock will automatically be disabled, unprepared and freed when
the device is unbound from the bus. So simplify mtk_smi_common_probe()
accordingly.
Signed-off-by: Rong Qianfeng <rongqianfeng@...o.com>
---
drivers/memory/mtk-smi.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/memory/mtk-smi.c b/drivers/memory/mtk-smi.c
index fbe52ecc0eca..2bc034dff691 100644
--- a/drivers/memory/mtk-smi.c
+++ b/drivers/memory/mtk-smi.c
@@ -771,13 +771,9 @@ static int mtk_smi_common_probe(struct platform_device *pdev)
if (IS_ERR(common->smi_ao_base))
return PTR_ERR(common->smi_ao_base);
- common->clk_async = devm_clk_get(dev, "async");
+ common->clk_async = devm_clk_get_enabled(dev, "async");
if (IS_ERR(common->clk_async))
return PTR_ERR(common->clk_async);
-
- ret = clk_prepare_enable(common->clk_async);
- if (ret)
- return ret;
} else {
common->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(common->base))
--
2.39.0
Powered by blists - more mailing lists