* [PATCH resend] ASoC: fsl_audmix: add missed pm_runtime_disable
@ 2019-12-03 11:13 Chuhong Yuan
2019-12-05 2:19 ` Nicolin Chen
0 siblings, 1 reply; 2+ messages in thread
From: Chuhong Yuan @ 2019-12-03 11:13 UTC (permalink / raw)
Cc: Timur Tabi, Nicolin Chen, Xiubo Li, Fabio Estevam, Liam Girdwood,
Mark Brown, Jaroslav Kysela, Takashi Iwai, alsa-devel,
linuxppc-dev, linux-kernel, Chuhong Yuan
The driver forgets to call pm_runtime_disable in probe failure
and remove.
Add the missed calls to fix it.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
sound/soc/fsl/fsl_audmix.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl_audmix.c
index a1db1bce330f..5faecbeb5497 100644
--- a/sound/soc/fsl/fsl_audmix.c
+++ b/sound/soc/fsl/fsl_audmix.c
@@ -505,15 +505,20 @@ static int fsl_audmix_probe(struct platform_device *pdev)
ARRAY_SIZE(fsl_audmix_dai));
if (ret) {
dev_err(dev, "failed to register ASoC DAI\n");
- return ret;
+ goto err_disable_pm;
}
priv->pdev = platform_device_register_data(dev, mdrv, 0, NULL, 0);
if (IS_ERR(priv->pdev)) {
ret = PTR_ERR(priv->pdev);
dev_err(dev, "failed to register platform %s: %d\n", mdrv, ret);
+ goto err_disable_pm;
}
+ return 0;
+
+err_disable_pm:
+ pm_runtime_disable(dev);
return ret;
}
@@ -521,6 +526,8 @@ static int fsl_audmix_remove(struct platform_device *pdev)
{
struct fsl_audmix *priv = dev_get_drvdata(&pdev->dev);
+ pm_runtime_disable(&pdev->dev);
+
if (priv->pdev)
platform_device_unregister(priv->pdev);
--
2.24.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH resend] ASoC: fsl_audmix: add missed pm_runtime_disable
2019-12-03 11:13 [PATCH resend] ASoC: fsl_audmix: add missed pm_runtime_disable Chuhong Yuan
@ 2019-12-05 2:19 ` Nicolin Chen
0 siblings, 0 replies; 2+ messages in thread
From: Nicolin Chen @ 2019-12-05 2:19 UTC (permalink / raw)
To: Chuhong Yuan
Cc: Timur Tabi, Xiubo Li, Fabio Estevam, Liam Girdwood, Mark Brown,
Jaroslav Kysela, Takashi Iwai, alsa-devel, linuxppc-dev,
linux-kernel
On Tue, Dec 03, 2019 at 07:13:03PM +0800, Chuhong Yuan wrote:
> The driver forgets to call pm_runtime_disable in probe failure
> and remove.
> Add the missed calls to fix it.
>
> Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Acked-by: Nicolin Chen <nicoleotsuka@gmail.com>
Thanks
> ---
> sound/soc/fsl/fsl_audmix.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/fsl/fsl_audmix.c b/sound/soc/fsl/fsl_audmix.c
> index a1db1bce330f..5faecbeb5497 100644
> --- a/sound/soc/fsl/fsl_audmix.c
> +++ b/sound/soc/fsl/fsl_audmix.c
> @@ -505,15 +505,20 @@ static int fsl_audmix_probe(struct platform_device *pdev)
> ARRAY_SIZE(fsl_audmix_dai));
> if (ret) {
> dev_err(dev, "failed to register ASoC DAI\n");
> - return ret;
> + goto err_disable_pm;
> }
>
> priv->pdev = platform_device_register_data(dev, mdrv, 0, NULL, 0);
> if (IS_ERR(priv->pdev)) {
> ret = PTR_ERR(priv->pdev);
> dev_err(dev, "failed to register platform %s: %d\n", mdrv, ret);
> + goto err_disable_pm;
> }
>
> + return 0;
> +
> +err_disable_pm:
> + pm_runtime_disable(dev);
> return ret;
> }
>
> @@ -521,6 +526,8 @@ static int fsl_audmix_remove(struct platform_device *pdev)
> {
> struct fsl_audmix *priv = dev_get_drvdata(&pdev->dev);
>
> + pm_runtime_disable(&pdev->dev);
> +
> if (priv->pdev)
> platform_device_unregister(priv->pdev);
>
> --
> 2.24.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-12-05 2:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-03 11:13 [PATCH resend] ASoC: fsl_audmix: add missed pm_runtime_disable Chuhong Yuan
2019-12-05 2:19 ` Nicolin Chen
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).