linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next v2] ASoC: Intel: Fix missing clk_disable_unprepare() on err in platform_clock_control()
@ 2022-07-19  1:36 Zhang Zekun
  2022-07-19 14:24 ` Pierre-Louis Bossart
  0 siblings, 1 reply; 2+ messages in thread
From: Zhang Zekun @ 2022-07-19  1:36 UTC (permalink / raw)
  To: cezary.rojewski, pierre-louis.bossart, liam.r.girdwood,
	peter.ujfalusi, yung-chuan.liao, ranjani.sridharan, kai.vehmanen
  Cc: linux-kernel, xuqiang36, zhangzekun11

Fix the missing clk_disable_unprepare() before return
from platform_clock_control() in error handling path.

Fixes: 9a87fc1e0619 ("ASoC: Intel: bytcr_wm5102: Add machine driver for BYT/WM5102")
Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
---
 sound/soc/intel/boards/bytcr_wm5102.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/intel/boards/bytcr_wm5102.c b/sound/soc/intel/boards/bytcr_wm5102.c
index 45a6805787f5..3e3cdee4b1ce 100644
--- a/sound/soc/intel/boards/bytcr_wm5102.c
+++ b/sound/soc/intel/boards/bytcr_wm5102.c
@@ -111,6 +111,7 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w,
 		ret = byt_wm5102_prepare_and_enable_pll1(codec_dai, 48000);
 		if (ret) {
 			dev_err(card->dev, "Error setting codec sysclk: %d\n", ret);
+			clk_disable_unprepare(priv->mclk);
 			return ret;
 		}
 	} else {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH -next v2] ASoC: Intel: Fix missing clk_disable_unprepare() on err in platform_clock_control()
  2022-07-19  1:36 [PATCH -next v2] ASoC: Intel: Fix missing clk_disable_unprepare() on err in platform_clock_control() Zhang Zekun
@ 2022-07-19 14:24 ` Pierre-Louis Bossart
  0 siblings, 0 replies; 2+ messages in thread
From: Pierre-Louis Bossart @ 2022-07-19 14:24 UTC (permalink / raw)
  To: Zhang Zekun, cezary.rojewski, liam.r.girdwood, peter.ujfalusi,
	yung-chuan.liao, ranjani.sridharan, kai.vehmanen,
	ALSA Development Mailing List, Mark Brown, Takashi Iwai,
	Hans de Goede
  Cc: linux-kernel, xuqiang36



On 7/18/22 20:36, Zhang Zekun wrote:
> Fix the missing clk_disable_unprepare() before return
> from platform_clock_control() in error handling path.
> 
> Fixes: 9a87fc1e0619 ("ASoC: Intel: bytcr_wm5102: Add machine driver for BYT/WM5102")
> Signed-off-by: Zhang Zekun <zhangzekun11@huawei.com>
> ---
>  sound/soc/intel/boards/bytcr_wm5102.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/sound/soc/intel/boards/bytcr_wm5102.c b/sound/soc/intel/boards/bytcr_wm5102.c
> index 45a6805787f5..3e3cdee4b1ce 100644
> --- a/sound/soc/intel/boards/bytcr_wm5102.c
> +++ b/sound/soc/intel/boards/bytcr_wm5102.c
> @@ -111,6 +111,7 @@ static int platform_clock_control(struct snd_soc_dapm_widget *w,
>  		ret = byt_wm5102_prepare_and_enable_pll1(codec_dai, 48000);
>  		if (ret) {
>  			dev_err(card->dev, "Error setting codec sysclk: %d\n", ret);
> +			clk_disable_unprepare(priv->mclk);

This change looks legit to me, but you want to CC: maintainers (Mark
Brown, Takashi Iwai), use the alsa-devel mailing list and CC: the
initial contributor Hans de Goede.

>  			return ret;
>  		}
>  	} else {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-07-19 14:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-19  1:36 [PATCH -next v2] ASoC: Intel: Fix missing clk_disable_unprepare() on err in platform_clock_control() Zhang Zekun
2022-07-19 14:24 ` Pierre-Louis Bossart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).