[PATCH 4/5] ASoC: kirkwood: kirkwood-i2s: Disable extclk on internal clk error
From: phucduc . bui
Date: Mon Oct 26 2026 - 07:07:49 EST
From: bui duc phuc <phucduc.bui@xxxxxxxxx>
kirkwood_i2s_dev_probe() enables the external clock before the
internal clock. If enabling the internal clock fails, the probe
returns directly, leaving the external clock enabled.
Jump to err_clk to disable the external clock on failure. Also reorder
the error path to disable the clocks in reverse order of enabling,
allowing the error labels to fall through.
Fixes: 4523817d51bc ("ASoC: kirkwood: fix external clock probe defer")
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
sound/soc/kirkwood/kirkwood-i2s.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sound/soc/kirkwood/kirkwood-i2s.c b/sound/soc/kirkwood/kirkwood-i2s.c
index 395790682355..cf6b96054b82 100644
--- a/sound/soc/kirkwood/kirkwood-i2s.c
+++ b/sound/soc/kirkwood/kirkwood-i2s.c
@@ -710,7 +710,7 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
err = clk_prepare_enable(priv->clk);
if (err < 0)
- return err;
+ goto err_clk;
/* Some sensible defaults - this reflects the powerup values */
priv->ctl_play = KIRKWOOD_PLAYCTL_SIZE_24;
@@ -734,10 +734,11 @@ static int kirkwood_i2s_dev_probe(struct platform_device *pdev)
return 0;
- err_component:
+err_component:
+ clk_disable_unprepare(priv->clk);
+err_clk:
if (!IS_ERR(priv->extclk))
clk_disable_unprepare(priv->extclk);
- clk_disable_unprepare(priv->clk);
return err;
}
--
2.43.0