ASoC: fsl_asrc fsl_esai fsl_sai: allow CONFIG_PM=N
authorMaarten Zanders <maarten.zanders@mind.be>
Fri, 28 Oct 2022 14:11:28 +0000 (16:11 +0200)
committerMark Brown <broonie@kernel.org>
Fri, 28 Oct 2022 16:14:43 +0000 (17:14 +0100)
When CONFIG_PM=N, pm_runtime_put_sync() returns -ENOSYS
which breaks the probe function of these drivers.

Other users of pm_runtime_put_sync() typically don't check
the return value. In order to keep the program flow as
intended, check for -ENOSYS.

This commit is similar to commit 0434d3f (omap-mailbox.c).

Fixes: cab04ab5900f ("ASoC: fsl_asrc: Don't use devm_regmap_init_mmio_clk")
Fixes: 203773e39347 ("ASoC: fsl_esai: Don't use devm_regmap_init_mmio_clk")
Fixes: 2277e7e36b4b ("ASoC: fsl_sai: Don't use devm_regmap_init_mmio_clk")
Signed-off-by: Maarten Zanders <maarten.zanders@mind.be>
Reviewed-by: Daniel Baluta <daniel.baluta@nxp.com>
Link: https://lore.kernel.org/r/20221028141129.100702-1-maarten.zanders@mind.be
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/fsl/fsl_asrc.c
sound/soc/fsl/fsl_esai.c
sound/soc/fsl/fsl_sai.c

index 936aef5d2767c5a1d47a8b66758995b9da38c914..e16e7b3fa96cce78688772f89571b1e3f1ef6498 100644 (file)
@@ -1232,7 +1232,7 @@ static int fsl_asrc_probe(struct platform_device *pdev)
        }
 
        ret = pm_runtime_put_sync(&pdev->dev);
-       if (ret < 0)
+       if (ret < 0 && ret != -ENOSYS)
                goto err_pm_get_sync;
 
        ret = devm_snd_soc_register_component(&pdev->dev, &fsl_asrc_component,
index 5c21fc490fce1ac1161ac1ce6b1ddaf799a00036..17fefd27ec90afeac6def55d320510d329a3db57 100644 (file)
@@ -1069,7 +1069,7 @@ static int fsl_esai_probe(struct platform_device *pdev)
        regmap_write(esai_priv->regmap, REG_ESAI_RSMB, 0);
 
        ret = pm_runtime_put_sync(&pdev->dev);
-       if (ret < 0)
+       if (ret < 0 && ret != -ENOSYS)
                goto err_pm_get_sync;
 
        /*
index 81f89f6767a2dd105fd0bd0aca724eed0ae49d2e..e60c7b3445623b625ff013297d249652e86018bd 100644 (file)
@@ -1446,7 +1446,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
        }
 
        ret = pm_runtime_put_sync(dev);
-       if (ret < 0)
+       if (ret < 0 && ret != -ENOSYS)
                goto err_pm_get_sync;
 
        /*