aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
diff options
context:
space:
mode:
authorMikhail Ulyanov <mikhail.ulyanov@cogentembedded.com>2015-10-01 09:03:32 -0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-11-19 08:04:28 -0200
commit886aa71bd4c3d22b1879cae3a4cd60d09b3fc25f (patch)
treeb4f62ac8a94b0f85e6ed8b201a994793772eec36 /drivers/media/platform
parent69ca0333e2486472e1738b4513e07bd768205f1c (diff)
[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: Mikhail Ulyanov <mikhail.ulyanov@cogentembedded.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform')
-rw-r--r--drivers/media/platform/rcar_jpu.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/platform/rcar_jpu.c b/drivers/media/platform/rcar_jpu.c
index 644f9f4907f4..86d2a3d18241 100644
--- a/drivers/media/platform/rcar_jpu.c
+++ b/drivers/media/platform/rcar_jpu.c
@@ -1300,17 +1300,17 @@ static int jpu_release(struct file *file)
struct jpu *jpu = video_drvdata(file);
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_ctrl_handler_free(&ctx->ctrl_handler);
v4l2_fh_del(&ctx->fh);
v4l2_fh_exit(&ctx->fh);
kfree(ctx);
+ mutex_lock(&jpu->mutex);
+ if (--jpu->ref_count == 0)
+ clk_disable_unprepare(jpu->clk);
+ mutex_unlock(&jpu->mutex);
+
return 0;
}

Privacy Policy