linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: atmel_ssc_dai: Handle errors for clk_enable
@ 2022-03-01  9:06 Jiasheng Jiang
  2022-03-01 11:18 ` Alexandre Belloni
  2022-03-02 17:00 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Jiasheng Jiang @ 2022-03-01  9:06 UTC (permalink / raw)
  To: codrin.ciubotariu, lgirdwood, broonie, perex, tiwai,
	nicolas.ferre, alexandre.belloni, claudiu.beznea
  Cc: alsa-devel, linux-arm-kernel, linux-kernel, Jiasheng Jiang

As the potential failure of the clk_enable(),
it should be better to check it and return error if fals.

Fixes: cbaadf0f90d6 ("ASoC: atmel_ssc_dai: refactor the startup and shutdown")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
 sound/soc/atmel/atmel_ssc_dai.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index 26e2bc690d86..c1dea8d62416 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -280,7 +280,10 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream,
 
 	/* Enable PMC peripheral clock for this SSC */
 	pr_debug("atmel_ssc_dai: Starting clock\n");
-	clk_enable(ssc_p->ssc->clk);
+	ret = clk_enable(ssc_p->ssc->clk);
+	if (ret)
+		return ret;
+
 	ssc_p->mck_rate = clk_get_rate(ssc_p->ssc->clk);
 
 	/* Reset the SSC unless initialized to keep it in a clean state */
-- 
2.25.1


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

* Re: [PATCH] ASoC: atmel_ssc_dai: Handle errors for clk_enable
  2022-03-01  9:06 [PATCH] ASoC: atmel_ssc_dai: Handle errors for clk_enable Jiasheng Jiang
@ 2022-03-01 11:18 ` Alexandre Belloni
  2022-03-01 12:46   ` Mark Brown
  2022-03-02 17:00 ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Alexandre Belloni @ 2022-03-01 11:18 UTC (permalink / raw)
  To: Jiasheng Jiang
  Cc: codrin.ciubotariu, lgirdwood, broonie, perex, tiwai,
	nicolas.ferre, claudiu.beznea, alsa-devel, linux-arm-kernel,
	linux-kernel

On 01/03/2022 17:06:37+0800, Jiasheng Jiang wrote:
> As the potential failure of the clk_enable(),
> it should be better to check it and return error if fals.
> 

As I already replied to an earlier patch, this will never, ever fail,
this patch doesn't fix anything.

> Fixes: cbaadf0f90d6 ("ASoC: atmel_ssc_dai: refactor the startup and shutdown")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
>  sound/soc/atmel/atmel_ssc_dai.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
> index 26e2bc690d86..c1dea8d62416 100644
> --- a/sound/soc/atmel/atmel_ssc_dai.c
> +++ b/sound/soc/atmel/atmel_ssc_dai.c
> @@ -280,7 +280,10 @@ static int atmel_ssc_startup(struct snd_pcm_substream *substream,
>  
>  	/* Enable PMC peripheral clock for this SSC */
>  	pr_debug("atmel_ssc_dai: Starting clock\n");
> -	clk_enable(ssc_p->ssc->clk);
> +	ret = clk_enable(ssc_p->ssc->clk);
> +	if (ret)
> +		return ret;
> +
>  	ssc_p->mck_rate = clk_get_rate(ssc_p->ssc->clk);
>  
>  	/* Reset the SSC unless initialized to keep it in a clean state */
> -- 
> 2.25.1
> 

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

* Re: [PATCH] ASoC: atmel_ssc_dai: Handle errors for clk_enable
  2022-03-01 11:18 ` Alexandre Belloni
@ 2022-03-01 12:46   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-03-01 12:46 UTC (permalink / raw)
  To: Alexandre Belloni
  Cc: Jiasheng Jiang, codrin.ciubotariu, lgirdwood, perex, tiwai,
	nicolas.ferre, claudiu.beznea, alsa-devel, linux-arm-kernel,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 484 bytes --]

On Tue, Mar 01, 2022 at 12:18:32PM +0100, Alexandre Belloni wrote:
> On 01/03/2022 17:06:37+0800, Jiasheng Jiang wrote:
> > As the potential failure of the clk_enable(),
> > it should be better to check it and return error if fals.

> As I already replied to an earlier patch, this will never, ever fail,
> this patch doesn't fix anything.

OTOH it doesn't do too much harm to have the error checking and it means
people don't have to check if this is a case where it doesn't matter.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] ASoC: atmel_ssc_dai: Handle errors for clk_enable
  2022-03-01  9:06 [PATCH] ASoC: atmel_ssc_dai: Handle errors for clk_enable Jiasheng Jiang
  2022-03-01 11:18 ` Alexandre Belloni
@ 2022-03-02 17:00 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2022-03-02 17:00 UTC (permalink / raw)
  To: lgirdwood, codrin.ciubotariu, perex, tiwai, nicolas.ferre,
	alexandre.belloni, Jiasheng Jiang, claudiu.beznea
  Cc: linux-kernel, alsa-devel, linux-arm-kernel

On Tue, 1 Mar 2022 17:06:37 +0800, Jiasheng Jiang wrote:
> As the potential failure of the clk_enable(),
> it should be better to check it and return error if fals.
> 
> 

Applied to

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

Thanks!

[1/1] ASoC: atmel_ssc_dai: Handle errors for clk_enable
      commit: f9e2ca0640e59d19af0ff285ee5591ed39069b09

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

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

end of thread, other threads:[~2022-03-02 17:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01  9:06 [PATCH] ASoC: atmel_ssc_dai: Handle errors for clk_enable Jiasheng Jiang
2022-03-01 11:18 ` Alexandre Belloni
2022-03-01 12:46   ` Mark Brown
2022-03-02 17:00 ` 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).