Commit baa450f0 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

media: sti/delta: 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.

Reviewed-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 10343de2
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -954,11 +954,9 @@ static void delta_run_work(struct work_struct *work)
	/* enable the hardware */
	if (!dec->pm) {
		ret = delta_get_sync(ctx);
		if (ret) {
			delta_put_autosuspend(ctx);
		if (ret)
			goto err;
	}
	}

	/* decode this access unit */
	ret = call_dec_op(dec, decode, ctx, au);
@@ -1277,9 +1275,9 @@ int delta_get_sync(struct delta_ctx *ctx)
	int ret = 0;

	/* enable the hardware */
	ret = pm_runtime_get_sync(delta->dev);
	ret = pm_runtime_resume_and_get(delta->dev);
	if (ret < 0) {
		dev_err(delta->dev, "%s pm_runtime_get_sync failed (%d)\n",
		dev_err(delta->dev, "%s pm_runtime_resume_and_get failed (%d)\n",
			__func__, ret);
		return ret;
	}