Skip to content

Commit d6d0d86

Browse files
committed
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>
1 parent b671036 commit d6d0d86

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

sound/soc/intel/atom/sst/sst_drv_interface.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,10 @@ static int sst_power_control(struct device *dev, bool state)
136136
int usage_count = 0;
137137

138138
if (state) {
139-
ret = pm_runtime_get_sync(dev);
139+
ret = pm_runtime_resume_and_get(dev);
140140
usage_count = GET_USAGE_COUNT(dev);
141141
dev_dbg(ctx->dev, "Enable: pm usage count: %d\n", usage_count);
142142
if (ret < 0) {
143-
pm_runtime_put_sync(dev);
144143
dev_err(ctx->dev, "Runtime get failed with err: %d\n", ret);
145144
return ret;
146145
}
@@ -193,11 +192,9 @@ static int sst_cdev_open(struct device *dev,
193192
struct stream_info *stream;
194193
struct intel_sst_drv *ctx = dev_get_drvdata(dev);
195194

196-
retval = pm_runtime_get_sync(ctx->dev);
197-
if (retval < 0) {
198-
pm_runtime_put_sync(ctx->dev);
195+
retval = pm_runtime_resume_and_get(ctx->dev);
196+
if (retval < 0)
199197
return retval;
200-
}
201198

202199
str_id = sst_get_stream(ctx, str_params);
203200
if (str_id > 0) {
@@ -645,11 +642,9 @@ static int sst_send_byte_stream(struct device *dev,
645642

646643
if (NULL == bytes)
647644
return -EINVAL;
648-
ret_val = pm_runtime_get_sync(ctx->dev);
649-
if (ret_val < 0) {
650-
pm_runtime_put_sync(ctx->dev);
645+
ret_val = pm_runtime_resume_and_get(ctx->dev);
646+
if (ret_val < 0)
651647
return ret_val;
652-
}
653648

654649
ret_val = sst_send_byte_stream_mrfld(ctx, bytes);
655650
sst_pm_runtime_put(ctx);

0 commit comments

Comments
 (0)