summaryrefslogtreecommitdiff
path: root/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
diff options
context:
space:
mode:
authorTiffany Lin <tiffany.lin@mediatek.com>2016-09-02 09:19:54 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-10-21 10:49:26 -0200
commit590577a4e5257ac3ed72999a94666ad6ba8f24bc (patch)
tree3c99a611c5b9b6643603dfd44b298fa6a0d33947 /drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
parentf3ad804c9dda66fb0087c9e210a23af69377ecb4 (diff)
[media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver
Add v4l2 layer decoder driver for MT8173 [mchehab@s-opensource.com: make checkpatch.pl happy] Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c')
-rw-r--r--drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
index 5cd2151431bf..aa81f3ce9463 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_drv.c
@@ -188,7 +188,6 @@ static int fops_vcodec_open(struct file *file)
mtk_v4l2_debug(2, "Create instance [%d]@%p m2m_ctx=%p ",
ctx->id, ctx, ctx->m2m_ctx);
- dev->num_instances++;
list_add(&ctx->list, &dev->ctx_list);
mutex_unlock(&dev->dev_mutex);
@@ -218,18 +217,13 @@ static int fops_vcodec_release(struct file *file)
mtk_v4l2_debug(1, "[%d] encoder", ctx->id);
mutex_lock(&dev->dev_mutex);
- /*
- * Call v4l2_m2m_ctx_release to make sure the worker thread is not
- * running after venc_if_deinit.
- */
- v4l2_m2m_ctx_release(ctx->m2m_ctx);
mtk_vcodec_enc_release(ctx);
v4l2_fh_del(&ctx->fh);
v4l2_fh_exit(&ctx->fh);
v4l2_ctrl_handler_free(&ctx->ctrl_hdl);
+ v4l2_m2m_ctx_release(ctx->m2m_ctx);
list_del_init(&ctx->list);
- dev->num_instances--;
kfree(ctx);
mutex_unlock(&dev->dev_mutex);
return 0;