Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 886aa71b authored by Mikhail Ulyanov's avatar Mikhail Ulyanov Committed by Mauro Carvalho Chehab
Browse files

[media] V4L2: platform: rcar_jpu: switch off clock on release later



Give JPU peripheral chance to finish current job.
Don't switch off clock until context release.

Signed-off-by: default avatarMikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 69ca0333
Loading
Loading
Loading
Loading
+5 −5
Original line number Original line Diff line number Diff line
@@ -1300,17 +1300,17 @@ static int jpu_release(struct file *file)
	struct jpu *jpu = video_drvdata(file);
	struct jpu *jpu = video_drvdata(file);
	struct jpu_ctx *ctx = fh_to_ctx(file->private_data);
	struct jpu_ctx *ctx = fh_to_ctx(file->private_data);


	mutex_lock(&jpu->mutex);
	if (--jpu->ref_count == 0)
		clk_disable_unprepare(jpu->clk);
	mutex_unlock(&jpu->mutex);

	v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
	v4l2_m2m_ctx_release(ctx->fh.m2m_ctx);
	v4l2_ctrl_handler_free(&ctx->ctrl_handler);
	v4l2_ctrl_handler_free(&ctx->ctrl_handler);
	v4l2_fh_del(&ctx->fh);
	v4l2_fh_del(&ctx->fh);
	v4l2_fh_exit(&ctx->fh);
	v4l2_fh_exit(&ctx->fh);
	kfree(ctx);
	kfree(ctx);


	mutex_lock(&jpu->mutex);
	if (--jpu->ref_count == 0)
		clk_disable_unprepare(jpu->clk);
	mutex_unlock(&jpu->mutex);

	return 0;
	return 0;
}
}