Skip to content

Commit ff39018

Browse files
qianfengrongkrzk
authored andcommitted
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: 3c8f4ad ("memory/mediatek: add support for mt2701") Cc: honghui.zhang@mediatek.com Signed-off-by: Rong Qianfeng <rongqianfeng@vivo.com> Reviewed-by: Yong Wu <yong.wu@mediatek.com> Link: https://lore.kernel.org/r/20240821032558.43052-1-rongqianfeng@vivo.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
1 parent ce53657 commit ff39018

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

drivers/memory/mtk-smi.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -771,13 +771,9 @@ static int mtk_smi_common_probe(struct platform_device *pdev)
771771
if (IS_ERR(common->smi_ao_base))
772772
return PTR_ERR(common->smi_ao_base);
773773

774-
common->clk_async = devm_clk_get(dev, "async");
774+
common->clk_async = devm_clk_get_enabled(dev, "async");
775775
if (IS_ERR(common->clk_async))
776776
return PTR_ERR(common->clk_async);
777-
778-
ret = clk_prepare_enable(common->clk_async);
779-
if (ret)
780-
return ret;
781777
} else {
782778
common->base = devm_platform_ioremap_resource(pdev, 0);
783779
if (IS_ERR(common->base))

0 commit comments

Comments
 (0)