ASoC: rockchip: spdif: Add missing clk_disable_unprepare() in rk_spdif_runtime_resume()
authorWang Jingjin <wangjingjin1@huawei.com>
Thu, 8 Dec 2022 06:39:00 +0000 (14:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 08:26:34 +0000 (09:26 +0100)
[ Upstream commit 6d94d0090527b1763872275a7ccd44df7219b31e ]

rk_spdif_runtime_resume() may have called clk_prepare_enable() before return
from failed branches, add missing clk_disable_unprepare() in this case.

Fixes: f874b80e1571 ("ASoC: rockchip: Add rockchip SPDIF transceiver driver")
Signed-off-by: Wang Jingjin <wangjingjin1@huawei.com>
Link: https://lore.kernel.org/r/20221208063900.4180790-1-wangjingjin1@huawei.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/rockchip/rockchip_spdif.c

index a89fe9b6463ba6b56d88c9afa6ae3fdd1397e6ae..5ac726da6015894cc7951e395103aca03d12878e 100644 (file)
@@ -89,6 +89,7 @@ static int __maybe_unused rk_spdif_runtime_resume(struct device *dev)
 
        ret = clk_prepare_enable(spdif->hclk);
        if (ret) {
+               clk_disable_unprepare(spdif->mclk);
                dev_err(spdif->dev, "hclk clock enable failed %d\n", ret);
                return ret;
        }