aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRong Qianfeng <[email protected]>2024-08-21 11:25:57 +0800
committerKrzysztof Kozlowski <[email protected]>2024-08-25 11:02:17 +0200
commitff390189b7f2cfa20c644bc58b4462b5e2621838 (patch)
tree4461163a407f9f0f4653057c96c2136e115b00c3
parentce536578e5652ec4da10ec69436d2ae2548bd619 (diff)
memory: mtk-smi: Use devm_clk_get_enabled()
Replace devm_clk_get() and clk_prepare_enable() with devm_clk_get_enabled() in .probe(). Fix the bug of missing clk_disable_unprepare() in .remove() by using devm_clk_get_enabled() that can disables and unprepares it automatically on driver detach. Fixes: 3c8f4ad85c4b ("memory/mediatek: add support for mt2701") Cc: [email protected] Signed-off-by: Rong Qianfeng <[email protected]> Reviewed-by: Yong Wu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Krzysztof Kozlowski <[email protected]>
-rw-r--r--drivers/memory/mtk-smi.c6
1 files changed, 1 insertions, 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))