diff options
author | Mark Brown <broonie@kernel.org> | 2022-04-27 23:01:23 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2022-04-27 23:01:23 +0100 |
commit | 87e291075d06ba1613d4b7b9c1f156b8d5c2526f (patch) | |
tree | 022a20a2abab30256fbf3ec76918883edb1742fd | |
parent | 9ce170dc9c08895846c5828addb724e42bf98484 (diff) | |
parent | 02885dd831c043d4804dfc1d2942f2f4ec5fdc18 (diff) |
ASoC: SOF: use pm_runtime_resume_and_get()
Merge series from Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>:
simplify code pattern as recommended by Mark Brown.
-rw-r--r-- | sound/soc/sof/control.c | 3 | ||||
-rw-r--r-- | sound/soc/sof/debug.c | 3 | ||||
-rw-r--r-- | sound/soc/sof/sof-client-ipc-msg-injector.c | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/sound/soc/sof/control.c b/sound/soc/sof/control.c index 3b5718a3516d..e0e9efd25d34 100644 --- a/sound/soc/sof/control.c +++ b/sound/soc/sof/control.c @@ -187,10 +187,9 @@ int snd_sof_bytes_ext_volatile_get(struct snd_kcontrol *kcontrol, unsigned int _ const struct sof_ipc_tplg_ops *tplg_ops = sdev->ipc->ops->tplg; int ret, err; - ret = pm_runtime_get_sync(scomp->dev); + ret = pm_runtime_resume_and_get(scomp->dev); if (ret < 0 && ret != -EACCES) { dev_err_ratelimited(scomp->dev, "%s: failed to resume %d\n", __func__, ret); - pm_runtime_put_noidle(scomp->dev); return ret; } diff --git a/sound/soc/sof/debug.c b/sound/soc/sof/debug.c index b59619ecfacf..54d3643b46ad 100644 --- a/sound/soc/sof/debug.c +++ b/sound/soc/sof/debug.c @@ -229,9 +229,8 @@ static int memory_info_update(struct snd_sof_dev *sdev, char *buf, size_t buff_s if (!reply) return -ENOMEM; - ret = pm_runtime_get_sync(sdev->dev); + ret = pm_runtime_resume_and_get(sdev->dev); if (ret < 0 && ret != -EACCES) { - pm_runtime_put_noidle(sdev->dev); dev_err(sdev->dev, "error: enabling device failed: %d\n", ret); goto error; } diff --git a/sound/soc/sof/sof-client-ipc-msg-injector.c b/sound/soc/sof/sof-client-ipc-msg-injector.c index dba6cfd7db09..c711981187aa 100644 --- a/sound/soc/sof/sof-client-ipc-msg-injector.c +++ b/sound/soc/sof/sof-client-ipc-msg-injector.c @@ -83,10 +83,9 @@ static ssize_t sof_msg_inject_dfs_write(struct file *file, const char __user *bu if (size != count) return size > 0 ? -EFAULT : size; - ret = pm_runtime_get_sync(dev); + ret = pm_runtime_resume_and_get(dev); if (ret < 0 && ret != -EACCES) { dev_err_ratelimited(dev, "debugfs write failed to resume %d\n", ret); - pm_runtime_put_noidle(dev); return ret; } |