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:
parent
7295e537bb
commit
97df01fae8
|
@ -920,7 +920,7 @@ static void mtk_jpeg_enc_device_run(void *priv)
|
||||||
src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
|
src_buf = v4l2_m2m_next_src_buf(ctx->fh.m2m_ctx);
|
||||||
dst_buf = v4l2_m2m_next_dst_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)
|
if (ret < 0)
|
||||||
goto enc_end;
|
goto enc_end;
|
||||||
|
|
||||||
|
@ -973,7 +973,7 @@ static void mtk_jpeg_dec_device_run(void *priv)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = pm_runtime_get_sync(jpeg->dev);
|
ret = pm_runtime_resume_and_get(jpeg->dev);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto dec_end;
|
goto dec_end;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue