From: phucduc.bui@gmail.com
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>,
linux-sound@vger.kernel.org,
Russell King <rmk+kernel@armlinux.org.uk>,
linux-kernel@vger.kernel.org,
bui duc phuc <phucduc.bui@gmail.com>
Subject: [PATCH 4/5] ASoC: kirkwood: kirkwood-i2s: Disable extclk on internal clk error
Date: Mon, 26 Oct 2026 17:58:34 +0700 [thread overview]
Message-ID: <20261026105835.19052-5-phucduc.bui@gmail.com> (raw)
In-Reply-To: <20261026105835.19052-1-phucduc.bui@gmail.com>
From: bui duc phuc <phucduc.bui@gmail.com>
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@gmail.com>
---
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
next prev parent reply other threads:[~2026-10-26 10:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-26 10:58 [PATCH 0/5] ASoC: kirkwood: Improve clock and error handling phucduc.bui
2026-10-26 10:58 ` [PATCH 1/5] ASoC: kirkwood: kirkwood-i2s: Fix error handling for resource mapping phucduc.bui
2026-10-26 10:58 ` [PATCH 2/5] ASoC: kirkwood: kirkwood-i2s: Improve error handling in probe phucduc.bui
2026-10-26 10:58 ` [PATCH 3/5] ASoC: kirkwood: kirkwood-i2s: Check return value of clk_prepare_enable() phucduc.bui
2026-10-26 10:58 ` phucduc.bui [this message]
2026-10-26 10:58 ` [PATCH 5/5] ASoC: kirkwood: kirkwood-i2s: Disable clocks in reverse order in remove() phucduc.bui
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261026105835.19052-5-phucduc.bui@gmail.com \
--to=phucduc.bui@gmail.com \
--cc=broonie@kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=rmk+kernel@armlinux.org.uk \
--cc=tiwai@suse.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.