memory: mtk-smi: Use devm_clk_get_enabled()
authorRong Qianfeng <rongqianfeng@vivo.com>
Wed, 21 Aug 2024 03:25:57 +0000 (11:25 +0800)
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Sun, 25 Aug 2024 09:02:17 +0000 (11:02 +0200)
commitff390189b7f2cfa20c644bc58b4462b5e2621838
tree4461163a407f9f0f4653057c96c2136e115b00c3
parentce536578e5652ec4da10ec69436d2ae2548bd619
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: 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>
drivers/memory/mtk-smi.c