linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: Intel: sof-rt5682: add a check for devm_clk_get
@ 2019-10-17  2:50 Chuhong Yuan
  2019-10-17 13:16 ` [alsa-devel] " Pierre-Louis Bossart
  2019-10-18 18:07 ` Applied "ASoC: Intel: sof-rt5682: add a check for devm_clk_get" to the asoc tree Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Chuhong Yuan @ 2019-10-17  2:50 UTC (permalink / raw)
  Cc: Cezary Rojewski, Pierre-Louis Bossart, Liam Girdwood, Jie Yang,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, alsa-devel,
	linux-kernel, Chuhong Yuan

sof_audio_probe misses a check for devm_clk_get and may cause problems.
Add a check for it to fix the bug.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
 sound/soc/intel/boards/sof_rt5682.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c
index a437567b8cee..6d15c7ff66bf 100644
--- a/sound/soc/intel/boards/sof_rt5682.c
+++ b/sound/soc/intel/boards/sof_rt5682.c
@@ -576,6 +576,15 @@ static int sof_audio_probe(struct platform_device *pdev)
 	/* need to get main clock from pmc */
 	if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
 		ctx->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
+		if (IS_ERR(ctx->mclk)) {
+			ret = PTR_ERR(ctx->mclk);
+
+			dev_err(&pdev->dev,
+				"Failed to get MCLK from pmc_plt_clk_3: %d\n",
+				ret);
+			return ret;
+		}
+
 		ret = clk_prepare_enable(ctx->mclk);
 		if (ret < 0) {
 			dev_err(&pdev->dev,
-- 
2.20.1


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

* Re: [alsa-devel] [PATCH] ASoC: Intel: sof-rt5682: add a check for devm_clk_get
  2019-10-17  2:50 [PATCH] ASoC: Intel: sof-rt5682: add a check for devm_clk_get Chuhong Yuan
@ 2019-10-17 13:16 ` Pierre-Louis Bossart
  2019-10-18 18:07 ` Applied "ASoC: Intel: sof-rt5682: add a check for devm_clk_get" to the asoc tree Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Pierre-Louis Bossart @ 2019-10-17 13:16 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: Cezary Rojewski, Liam Girdwood, Jie Yang, Mark Brown,
	Jaroslav Kysela, Takashi Iwai, alsa-devel, linux-kernel



On 10/16/19 9:50 PM, Chuhong Yuan wrote:
> sof_audio_probe misses a check for devm_clk_get and may cause problems.
> Add a check for it to fix the bug.

Indeed this is a miss, we have this test in all machine drivers except 
this one. Thanks for the patch!

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

> 
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
> ---
>   sound/soc/intel/boards/sof_rt5682.c | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c
> index a437567b8cee..6d15c7ff66bf 100644
> --- a/sound/soc/intel/boards/sof_rt5682.c
> +++ b/sound/soc/intel/boards/sof_rt5682.c
> @@ -576,6 +576,15 @@ static int sof_audio_probe(struct platform_device *pdev)
>   	/* need to get main clock from pmc */
>   	if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
>   		ctx->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
> +		if (IS_ERR(ctx->mclk)) {
> +			ret = PTR_ERR(ctx->mclk);
> +
> +			dev_err(&pdev->dev,
> +				"Failed to get MCLK from pmc_plt_clk_3: %d\n",
> +				ret);
> +			return ret;
> +		}
> +
>   		ret = clk_prepare_enable(ctx->mclk);
>   		if (ret < 0) {
>   			dev_err(&pdev->dev,
> 

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

* Applied "ASoC: Intel: sof-rt5682: add a check for devm_clk_get" to the asoc tree
  2019-10-17  2:50 [PATCH] ASoC: Intel: sof-rt5682: add a check for devm_clk_get Chuhong Yuan
  2019-10-17 13:16 ` [alsa-devel] " Pierre-Louis Bossart
@ 2019-10-18 18:07 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2019-10-18 18:07 UTC (permalink / raw)
  To: Chuhong Yuan
  Cc: alsa-devel, Cc:, Cc:,
	Cezary Rojewski, Jaroslav Kysela, Jie Yang, Liam Girdwood,
	linux-kernel, Mark Brown, Pierre-Louis Bossart, Takashi Iwai

The patch

   ASoC: Intel: sof-rt5682: add a check for devm_clk_get

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From e5f0d490fb718254a884453e47fcd48493cd67ea Mon Sep 17 00:00:00 2001
From: Chuhong Yuan <hslester96@gmail.com>
Date: Thu, 17 Oct 2019 10:50:44 +0800
Subject: [PATCH] ASoC: Intel: sof-rt5682: add a check for devm_clk_get

sof_audio_probe misses a check for devm_clk_get and may cause problems.
Add a check for it to fix the bug.

Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20191017025044.31474-1-hslester96@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/intel/boards/sof_rt5682.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/sound/soc/intel/boards/sof_rt5682.c b/sound/soc/intel/boards/sof_rt5682.c
index 5ce643d62faf..4f6e58c3954a 100644
--- a/sound/soc/intel/boards/sof_rt5682.c
+++ b/sound/soc/intel/boards/sof_rt5682.c
@@ -603,6 +603,15 @@ static int sof_audio_probe(struct platform_device *pdev)
 	/* need to get main clock from pmc */
 	if (sof_rt5682_quirk & SOF_RT5682_MCLK_BYTCHT_EN) {
 		ctx->mclk = devm_clk_get(&pdev->dev, "pmc_plt_clk_3");
+		if (IS_ERR(ctx->mclk)) {
+			ret = PTR_ERR(ctx->mclk);
+
+			dev_err(&pdev->dev,
+				"Failed to get MCLK from pmc_plt_clk_3: %d\n",
+				ret);
+			return ret;
+		}
+
 		ret = clk_prepare_enable(ctx->mclk);
 		if (ret < 0) {
 			dev_err(&pdev->dev,
-- 
2.20.1


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

end of thread, other threads:[~2019-10-18 18:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-17  2:50 [PATCH] ASoC: Intel: sof-rt5682: add a check for devm_clk_get Chuhong Yuan
2019-10-17 13:16 ` [alsa-devel] " Pierre-Louis Bossart
2019-10-18 18:07 ` Applied "ASoC: Intel: sof-rt5682: add a check for devm_clk_get" to the asoc tree Mark Brown

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).