* [PATCH] ASoC: ti: davinci-i2s: Add check for clk_enable()
@ 2022-02-28 3:15 Jiasheng Jiang
2022-02-28 12:24 ` Péter Ujfalusi
2022-02-28 19:15 ` Mark Brown
0 siblings, 2 replies; 3+ messages in thread
From: Jiasheng Jiang @ 2022-02-28 3:15 UTC (permalink / raw)
To: peter.ujfalusi, lgirdwood, broonie, perex, tiwai
Cc: alsa-devel, linux-kernel, Jiasheng Jiang
As the potential failure of the clk_enable(),
it should be better to check it and return error
if fails.
Fixes: 5f9a50c3e55e ("ASoC: Davinci: McBSP: add device tree support for McBSP")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
---
sound/soc/ti/davinci-i2s.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/sound/soc/ti/davinci-i2s.c b/sound/soc/ti/davinci-i2s.c
index 6dca51862dd7..0363a088d2e0 100644
--- a/sound/soc/ti/davinci-i2s.c
+++ b/sound/soc/ti/davinci-i2s.c
@@ -708,7 +708,9 @@ static int davinci_i2s_probe(struct platform_device *pdev)
dev->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(dev->clk))
return -ENODEV;
- clk_enable(dev->clk);
+ ret = clk_enable(dev->clk);
+ if (ret)
+ goto err_put_clk;
dev->dev = &pdev->dev;
dev_set_drvdata(&pdev->dev, dev);
@@ -730,6 +732,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
snd_soc_unregister_component(&pdev->dev);
err_release_clk:
clk_disable(dev->clk);
+err_put_clk:
clk_put(dev->clk);
return ret;
}
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ASoC: ti: davinci-i2s: Add check for clk_enable()
2022-02-28 3:15 [PATCH] ASoC: ti: davinci-i2s: Add check for clk_enable() Jiasheng Jiang
@ 2022-02-28 12:24 ` Péter Ujfalusi
2022-02-28 19:15 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Péter Ujfalusi @ 2022-02-28 12:24 UTC (permalink / raw)
To: Jiasheng Jiang, lgirdwood, broonie, perex, tiwai; +Cc: alsa-devel, linux-kernel
On 28/02/2022 05:15, Jiasheng Jiang wrote:
> As the potential failure of the clk_enable(),
> it should be better to check it and return error
> if fails.
Thank you for the patch!
Acked-by: Peter Ujfalusi <peter.ujfalusi@gmail.com>
>
> Fixes: 5f9a50c3e55e ("ASoC: Davinci: McBSP: add device tree support for McBSP")
> Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
> ---
> sound/soc/ti/davinci-i2s.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/ti/davinci-i2s.c b/sound/soc/ti/davinci-i2s.c
> index 6dca51862dd7..0363a088d2e0 100644
> --- a/sound/soc/ti/davinci-i2s.c
> +++ b/sound/soc/ti/davinci-i2s.c
> @@ -708,7 +708,9 @@ static int davinci_i2s_probe(struct platform_device *pdev)
> dev->clk = clk_get(&pdev->dev, NULL);
> if (IS_ERR(dev->clk))
> return -ENODEV;
> - clk_enable(dev->clk);
> + ret = clk_enable(dev->clk);
> + if (ret)
> + goto err_put_clk;
>
> dev->dev = &pdev->dev;
> dev_set_drvdata(&pdev->dev, dev);
> @@ -730,6 +732,7 @@ static int davinci_i2s_probe(struct platform_device *pdev)
> snd_soc_unregister_component(&pdev->dev);
> err_release_clk:
> clk_disable(dev->clk);
> +err_put_clk:
> clk_put(dev->clk);
> return ret;
> }
--
Péter
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] ASoC: ti: davinci-i2s: Add check for clk_enable()
2022-02-28 3:15 [PATCH] ASoC: ti: davinci-i2s: Add check for clk_enable() Jiasheng Jiang
2022-02-28 12:24 ` Péter Ujfalusi
@ 2022-02-28 19:15 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2022-02-28 19:15 UTC (permalink / raw)
To: perex, tiwai, peter.ujfalusi, lgirdwood, Jiasheng Jiang
Cc: alsa-devel, linux-kernel
On Mon, 28 Feb 2022 11:15:40 +0800, Jiasheng Jiang wrote:
> As the potential failure of the clk_enable(),
> it should be better to check it and return error
> if fails.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: ti: davinci-i2s: Add check for clk_enable()
commit: ed7c9fef11931fc5d32a83d68017ff390bf5c280
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] 3+ messages in thread
end of thread, other threads:[~2022-02-28 19:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-28 3:15 [PATCH] ASoC: ti: davinci-i2s: Add check for clk_enable() Jiasheng Jiang
2022-02-28 12:24 ` Péter Ujfalusi
2022-02-28 19:15 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®