media: mtk-jpeg: use pm_runtime_resume_and_get()

Commit dd8088d5a8 ("PM: runtime: Add pm_runtime_resume_and_get to deal with usage counter")
added pm_runtime_resume_and_get() in order to automatically handle
dev->power.usage_count decrement on errors.

Use the new API, in order to cleanup the error check logic.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Mauro Carvalho Chehab 2021-04-23 17:19:18 +02:00
parent 7295e537bb
commit 97df01fae8
1 changed files with 2 additions and 2 deletions

View File

@ -920,7 +920,7 @@ static void mtk_jpeg_enc_device_run(void *priv)
src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
dst_buf = v4l2_m2m_next_dst_buf(ctx->fh.m2m_ctx);
ret = pm_runtime_get_sync(jpeg->dev);
ret = pm_runtime_resume_and_get(jpeg->dev);
if (ret < 0)
goto enc_end;
@ -973,7 +973,7 @@ static void mtk_jpeg_dec_device_run(void *priv)
return;
}
ret = pm_runtime_get_sync(jpeg->dev);
ret = pm_runtime_resume_and_get(jpeg->dev);
if (ret < 0)
goto dec_end;