Commit 57ed510b authored by Pierre-Louis Bossart's avatar Pierre-Louis Bossart Committed by Vinod Koul

soundwire: qcom: use pm_runtime_resume_and_get()

Use pm_runtime_resume_and_get() to replace the pm_runtime_get_sync() and
pm_runtime_put_noidle() pattern.

No functional changes.
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: default avatarPéter Ujfalusi <peter.ujfalusi@linux.intel.com>
Signed-off-by: default avatarBard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20220426235623.4253-6-yung-chuan.liao@linux.intel.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent fff1fd9c
...@@ -510,12 +510,11 @@ static irqreturn_t qcom_swrm_wake_irq_handler(int irq, void *dev_id) ...@@ -510,12 +510,11 @@ static irqreturn_t qcom_swrm_wake_irq_handler(int irq, void *dev_id)
struct qcom_swrm_ctrl *swrm = dev_id; struct qcom_swrm_ctrl *swrm = dev_id;
int ret; int ret;
ret = pm_runtime_get_sync(swrm->dev); ret = pm_runtime_resume_and_get(swrm->dev);
if (ret < 0 && ret != -EACCES) { if (ret < 0 && ret != -EACCES) {
dev_err_ratelimited(swrm->dev, dev_err_ratelimited(swrm->dev,
"pm_runtime_get_sync failed in %s, ret %d\n", "pm_runtime_resume_and_get failed in %s, ret %d\n",
__func__, ret); __func__, ret);
pm_runtime_put_noidle(swrm->dev);
return ret; return ret;
} }
...@@ -1059,12 +1058,11 @@ static int qcom_swrm_startup(struct snd_pcm_substream *substream, ...@@ -1059,12 +1058,11 @@ static int qcom_swrm_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *codec_dai; struct snd_soc_dai *codec_dai;
int ret, i; int ret, i;
ret = pm_runtime_get_sync(ctrl->dev); ret = pm_runtime_resume_and_get(ctrl->dev);
if (ret < 0 && ret != -EACCES) { if (ret < 0 && ret != -EACCES) {
dev_err_ratelimited(ctrl->dev, dev_err_ratelimited(ctrl->dev,
"pm_runtime_get_sync failed in %s, ret %d\n", "pm_runtime_resume_and_get failed in %s, ret %d\n",
__func__, ret); __func__, ret);
pm_runtime_put_noidle(ctrl->dev);
return ret; return ret;
} }
...@@ -1253,12 +1251,11 @@ static int swrm_reg_show(struct seq_file *s_file, void *data) ...@@ -1253,12 +1251,11 @@ static int swrm_reg_show(struct seq_file *s_file, void *data)
struct qcom_swrm_ctrl *swrm = s_file->private; struct qcom_swrm_ctrl *swrm = s_file->private;
int reg, reg_val, ret; int reg, reg_val, ret;
ret = pm_runtime_get_sync(swrm->dev); ret = pm_runtime_resume_and_get(swrm->dev);
if (ret < 0 && ret != -EACCES) { if (ret < 0 && ret != -EACCES) {
dev_err_ratelimited(swrm->dev, dev_err_ratelimited(swrm->dev,
"pm_runtime_get_sync failed in %s, ret %d\n", "pm_runtime_resume_and_get failed in %s, ret %d\n",
__func__, ret); __func__, ret);
pm_runtime_put_noidle(swrm->dev);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment