[PATCH] ASoC: Intel: atom: use pm_runtime_resume_and_get()
Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_sync() pattern.
No functional changes.
Signed-off-by: Pierre-Louis Bossart pierre-louis.bossart@linux.intel.com Reviewed-by: Péter Ujfalusi peter.ujfalusi@linux.intel.com Reviewed-by: Bard Liao yung-chuan.liao@linux.intel.com --- sound/soc/intel/atom/sst/sst_drv_interface.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
diff --git a/sound/soc/intel/atom/sst/sst_drv_interface.c b/sound/soc/intel/atom/sst/sst_drv_interface.c index 0af618dd80730..dc31c2c8f54c8 100644 --- a/sound/soc/intel/atom/sst/sst_drv_interface.c +++ b/sound/soc/intel/atom/sst/sst_drv_interface.c @@ -136,11 +136,10 @@ static int sst_power_control(struct device *dev, bool state) int usage_count = 0;
if (state) { - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); usage_count = GET_USAGE_COUNT(dev); dev_dbg(ctx->dev, "Enable: pm usage count: %d\n", usage_count); if (ret < 0) { - pm_runtime_put_sync(dev); dev_err(ctx->dev, "Runtime get failed with err: %d\n", ret); return ret; } @@ -193,11 +192,9 @@ static int sst_cdev_open(struct device *dev, struct stream_info *stream; struct intel_sst_drv *ctx = dev_get_drvdata(dev);
- retval = pm_runtime_get_sync(ctx->dev); - if (retval < 0) { - pm_runtime_put_sync(ctx->dev); + retval = pm_runtime_resume_and_get(ctx->dev); + if (retval < 0) return retval; - }
str_id = sst_get_stream(ctx, str_params); if (str_id > 0) { @@ -645,11 +642,9 @@ static int sst_send_byte_stream(struct device *dev,
if (NULL == bytes) return -EINVAL; - ret_val = pm_runtime_get_sync(ctx->dev); - if (ret_val < 0) { - pm_runtime_put_sync(ctx->dev); + ret_val = pm_runtime_resume_and_get(ctx->dev); + if (ret_val < 0) return ret_val; - }
ret_val = sst_send_byte_stream_mrfld(ctx, bytes); sst_pm_runtime_put(ctx);
On Tue, 26 Apr 2022 13:38:07 -0500, Pierre-Louis Bossart wrote:
Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and pm_runtime_put_sync() pattern.
No functional changes.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: Intel: atom: use pm_runtime_resume_and_get() commit: d879e9444634e3ef7cc5646fca0892c4f1483a8d
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks, Mark
participants (2)
-
Mark Brown
-
Pierre-Louis Bossart