Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
ASoC: fsl_asrc fsl_esai fsl_sai: allow CONFIG_PM=N
Browse files Browse the repository at this point in the history
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: cab04ab ("ASoC: fsl_asrc: Don't use devm_regmap_init_mmio_clk")
Fixes: 203773e ("ASoC: fsl_esai: Don't use devm_regmap_init_mmio_clk")
Fixes: 2277e7e ("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>
  • Loading branch information
mzanders authored and broonie committed Oct 28, 2022
1 parent 6ec27c5 commit 6a56433
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion sound/soc/fsl/fsl_asrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/fsl/fsl_esai.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/fsl/fsl_sai.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/*
Expand Down

0 comments on commit 6a56433

Please sign in to comment.