Skip to content

Commit 17955ab

Browse files
TE-N-ShengjiuWangbroonie
authored andcommitted
ASoC: fsl_micfil: Fix error handler with pm_runtime_enable
There is error message when defer probe happens: fsl-micfil-dai 30ca0000.micfil: Unbalanced pm_runtime_enable! Fix the error handler with pm_runtime_enable and add fsl_micfil_remove() for pm_runtime_disable. Fixes: 47a70e6 ("ASoC: Add MICFIL SoC Digital Audio Interface driver.") Signed-off-by: Shengjiu Wang <[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]
1 parent ab6ecfb commit 17955ab

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

sound/soc/fsl/fsl_micfil.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1159,7 +1159,7 @@ static int fsl_micfil_probe(struct platform_device *pdev)
11591159
ret = devm_snd_dmaengine_pcm_register(&pdev->dev, NULL, 0);
11601160
if (ret) {
11611161
dev_err(&pdev->dev, "failed to pcm register\n");
1162-
return ret;
1162+
goto err_pm_disable;
11631163
}
11641164

11651165
fsl_micfil_dai.capture.formats = micfil->soc->formats;
@@ -1169,9 +1169,20 @@ static int fsl_micfil_probe(struct platform_device *pdev)
11691169
if (ret) {
11701170
dev_err(&pdev->dev, "failed to register component %s\n",
11711171
fsl_micfil_component.name);
1172+
goto err_pm_disable;
11721173
}
11731174

11741175
return ret;
1176+
1177+
err_pm_disable:
1178+
pm_runtime_disable(&pdev->dev);
1179+
1180+
return ret;
1181+
}
1182+
1183+
static void fsl_micfil_remove(struct platform_device *pdev)
1184+
{
1185+
pm_runtime_disable(&pdev->dev);
11751186
}
11761187

11771188
static int __maybe_unused fsl_micfil_runtime_suspend(struct device *dev)
@@ -1232,6 +1243,7 @@ static const struct dev_pm_ops fsl_micfil_pm_ops = {
12321243

12331244
static struct platform_driver fsl_micfil_driver = {
12341245
.probe = fsl_micfil_probe,
1246+
.remove_new = fsl_micfil_remove,
12351247
.driver = {
12361248
.name = "fsl-micfil-dai",
12371249
.pm = &fsl_micfil_pm_ops,

0 commit comments

Comments
 (0)