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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 2 Dec 2022 16:40:59 +0000 (17:40 +0100)
[ Upstream commit 6a564338a23cefcfc29c4a535b98402d13efdda6 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/fsl/fsl_asrc.c
sound/soc/fsl/fsl_esai.c
sound/soc/fsl/fsl_sai.c

index 44dcbf49456cbefc19ac7986bac2352a38c5fd97..08ca410ef551b9fbeba4d6828fca682bb6017fd7 100644 (file)
@@ -1226,7 +1226,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 bda66b30e063c24f4eb982288cdb5654dc701985..763f5f0592af1584cf3f7a027c6a9d6a22f3ec29 100644 (file)
@@ -1070,7 +1070,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 bcf6b66a5ac0b6e6d16e8600efee8ff2a51656fb..5ba06df2ace519ec38c18fc0313574610a4eb507 100644 (file)
@@ -1150,7 +1150,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;
 
        /*