Commit 0d72f489 authored by Yu Kuai's avatar Yu Kuai Committed by Mauro Carvalho Chehab

media: platform: add missing put_device() call in mtk_jpeg_probe() and mtk_jpeg_remove()

if mtk_jpeg_clk_init() succeed, mtk_jpeg_probe() and mtk_jpeg_remove()
doesn't have a corresponding put_device(). Thus add a new helper
mtk_jpeg_clk_release() to fix it.

Fixes: b2f0d272 ("[media] vcodec: mediatek: Add Mediatek JPEG Decoder Driver")
Signed-off-by: default avatarYu Kuai <yukuai3@huawei.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent f50613c1
...@@ -1332,6 +1332,12 @@ static void mtk_jpeg_job_timeout_work(struct work_struct *work) ...@@ -1332,6 +1332,12 @@ static void mtk_jpeg_job_timeout_work(struct work_struct *work)
v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_ERROR); v4l2_m2m_buf_done(dst_buf, VB2_BUF_STATE_ERROR);
v4l2_m2m_job_finish(jpeg->m2m_dev, ctx->fh.m2m_ctx); v4l2_m2m_job_finish(jpeg->m2m_dev, ctx->fh.m2m_ctx);
} }
static inline void mtk_jpeg_clk_release(struct mtk_jpeg_dev *jpeg)
{
put_device(jpeg->larb);
}
static int mtk_jpeg_probe(struct platform_device *pdev) static int mtk_jpeg_probe(struct platform_device *pdev)
{ {
struct mtk_jpeg_dev *jpeg; struct mtk_jpeg_dev *jpeg;
...@@ -1436,6 +1442,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev) ...@@ -1436,6 +1442,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
v4l2_device_unregister(&jpeg->v4l2_dev); v4l2_device_unregister(&jpeg->v4l2_dev);
err_dev_register: err_dev_register:
mtk_jpeg_clk_release(jpeg);
err_clk_init: err_clk_init:
...@@ -1453,6 +1460,7 @@ static int mtk_jpeg_remove(struct platform_device *pdev) ...@@ -1453,6 +1460,7 @@ static int mtk_jpeg_remove(struct platform_device *pdev)
video_device_release(jpeg->vdev); video_device_release(jpeg->vdev);
v4l2_m2m_release(jpeg->m2m_dev); v4l2_m2m_release(jpeg->m2m_dev);
v4l2_device_unregister(&jpeg->v4l2_dev); v4l2_device_unregister(&jpeg->v4l2_dev);
mtk_jpeg_clk_release(jpeg);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment