Commit 97df01fa authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: mtk-jpeg: use pm_runtime_resume_and_get()



Commit dd8088d5 ("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: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 7295e537
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;