linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 0/7] patches to add missing put_device() call
@ 2020-10-09 12:37 Yu Kuai
  2020-10-09 12:37 ` [PATCH 1/7] media: platform: add missing put_device() call in mtk_jpeg_clk_init() Yu Kuai
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Yu Kuai @ 2020-10-09 12:37 UTC (permalink / raw)
  To: rick.chang, bin.liu, mchehab, matthias.bgg, tiffany.lin,
	andrew-ct.chen, tfiga, xia.jiang, hverkuil-cisco, jcliang,
	minghsiu.tsai
  Cc: linux-media, linux-arm-kernel, linux-mediatek, linux-kernel,
	yukuai3, yi.zhang

changes in V2:
 - add several patches suggested by Hans

Yu Kuai (7):
  media: platform: add missing put_device() call in mtk_jpeg_clk_init()
  media: platform: add missing put_device() call in mtk_jpeg_probe()
  media: platform: add missing put_device() call in mtk_jpeg_remove()
  media: mtk-vcodec: add missing put_device() call in
    mtk_vcodec_init_dec_pm()
  media: mtk-vcodec: add missing put_device() call in
    mtk_vcodec_release_dec_pm()
  media: mtk-vcodec: add missing put_device() call in
    mtk_vcodec_init_enc_pm()
  media: mtk-vcodec: add missing put_device() call in
    mtk_vcodec_release_enc_pm()

 .../media/platform/mtk-jpeg/mtk_jpeg_core.c   |  3 ++
 .../platform/mtk-vcodec/mtk_vcodec_dec_pm.c   | 19 +++++++++----
 .../platform/mtk-vcodec/mtk_vcodec_enc_pm.c   | 28 ++++++++++++++-----
 3 files changed, 37 insertions(+), 13 deletions(-)

-- 
2.25.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/7] media: platform: add missing put_device() call in mtk_jpeg_clk_init()
  2020-10-09 12:37 [PATCH V2 0/7] patches to add missing put_device() call Yu Kuai
@ 2020-10-09 12:37 ` Yu Kuai
  2020-10-09 12:37 ` [PATCH 2/7] media: platform: add missing put_device() call in mtk_jpeg_probe() Yu Kuai
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Yu Kuai @ 2020-10-09 12:37 UTC (permalink / raw)
  To: rick.chang, bin.liu, mchehab, matthias.bgg, tiffany.lin,
	andrew-ct.chen, tfiga, xia.jiang, hverkuil-cisco, jcliang,
	minghsiu.tsai
  Cc: linux-media, linux-arm-kernel, linux-mediatek, linux-kernel,
	yukuai3, yi.zhang

if of_find_device_by_node() succeed, mtk_jpeg_clk_init() doesn't have
a corresponding put_device(). Thus add put_device() to fix the exception
handling for this function implementation.

Fixes: 648372a87cee ("media: platform: Change the call functions of getting/enable/disable the jpeg's clock")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
index 227245ccaedc..106543391c46 100644
--- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
@@ -1306,6 +1306,7 @@ static int mtk_jpeg_clk_init(struct mtk_jpeg_dev *jpeg)
 				jpeg->variant->clks);
 	if (ret) {
 		dev_err(&pdev->dev, "failed to get jpeg clock:%d\n", ret);
+		put_device(&pdev->dev);
 		return ret;
 	}
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/7] media: platform: add missing put_device() call in mtk_jpeg_probe()
  2020-10-09 12:37 [PATCH V2 0/7] patches to add missing put_device() call Yu Kuai
  2020-10-09 12:37 ` [PATCH 1/7] media: platform: add missing put_device() call in mtk_jpeg_clk_init() Yu Kuai
@ 2020-10-09 12:37 ` Yu Kuai
  2020-10-30  9:46   ` Hans Verkuil
  2020-10-09 12:38 ` [PATCH 3/7] media: platform: add missing put_device() call in mtk_jpeg_remove() Yu Kuai
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 9+ messages in thread
From: Yu Kuai @ 2020-10-09 12:37 UTC (permalink / raw)
  To: rick.chang, bin.liu, mchehab, matthias.bgg, tiffany.lin,
	andrew-ct.chen, tfiga, xia.jiang, hverkuil-cisco, jcliang,
	minghsiu.tsai
  Cc: linux-media, linux-arm-kernel, linux-mediatek, linux-kernel,
	yukuai3, yi.zhang

if mtk_jpeg_clk_init() succeed, mtk_jpeg_probe() doesn't have a
corresponding put_device(). Thus add put_device() in jump target to fix
the exception handling for this function implementation.

Fixes: b2f0d2724ba4 ("[media] vcodec: mediatek: Add Mediatek JPEG Decoder Driver")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
index 106543391c46..f0c412f96d61 100644
--- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
@@ -1436,6 +1436,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
 	v4l2_device_unregister(&jpeg->v4l2_dev);
 
 err_dev_register:
+	put_device(jpeg->larb);
 
 err_clk_init:
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/7] media: platform: add missing put_device() call in mtk_jpeg_remove()
  2020-10-09 12:37 [PATCH V2 0/7] patches to add missing put_device() call Yu Kuai
  2020-10-09 12:37 ` [PATCH 1/7] media: platform: add missing put_device() call in mtk_jpeg_clk_init() Yu Kuai
  2020-10-09 12:37 ` [PATCH 2/7] media: platform: add missing put_device() call in mtk_jpeg_probe() Yu Kuai
@ 2020-10-09 12:38 ` Yu Kuai
  2020-10-09 12:38 ` [PATCH 4/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_dec_pm() Yu Kuai
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Yu Kuai @ 2020-10-09 12:38 UTC (permalink / raw)
  To: rick.chang, bin.liu, mchehab, matthias.bgg, tiffany.lin,
	andrew-ct.chen, tfiga, xia.jiang, hverkuil-cisco, jcliang,
	minghsiu.tsai
  Cc: linux-media, linux-arm-kernel, linux-mediatek, linux-kernel,
	yukuai3, yi.zhang

of_find_device_by_node() is called in mtk_jpeg_clk_init() from
mtk_jpeg_probe(), and mtk_jpeg_remove() doesn't have a corresponding
put_device().

Fixes: b2f0d2724ba4 ("[media] vcodec: mediatek: Add Mediatek JPEG Decoder Driver")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
index f0c412f96d61..87535f5142fa 100644
--- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
+++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
@@ -1454,6 +1454,7 @@ static int mtk_jpeg_remove(struct platform_device *pdev)
 	video_device_release(jpeg->vdev);
 	v4l2_m2m_release(jpeg->m2m_dev);
 	v4l2_device_unregister(&jpeg->v4l2_dev);
+	put_device(jpeg->larb);
 
 	return 0;
 }
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_dec_pm()
  2020-10-09 12:37 [PATCH V2 0/7] patches to add missing put_device() call Yu Kuai
                   ` (2 preceding siblings ...)
  2020-10-09 12:38 ` [PATCH 3/7] media: platform: add missing put_device() call in mtk_jpeg_remove() Yu Kuai
@ 2020-10-09 12:38 ` Yu Kuai
  2020-10-09 12:38 ` [PATCH 5/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_dec_pm() Yu Kuai
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Yu Kuai @ 2020-10-09 12:38 UTC (permalink / raw)
  To: rick.chang, bin.liu, mchehab, matthias.bgg, tiffany.lin,
	andrew-ct.chen, tfiga, xia.jiang, hverkuil-cisco, jcliang,
	minghsiu.tsai
  Cc: linux-media, linux-arm-kernel, linux-mediatek, linux-kernel,
	yukuai3, yi.zhang

if of_find_device_by_node() succeed, mtk_vcodec_init_dec_pm() doesn't have
a corresponding put_device(). Thus add jump target to fix the exception
handling for this function implementation.

Fixes: 590577a4e525 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 .../platform/mtk-vcodec/mtk_vcodec_dec_pm.c    | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c
index 36dfe3fc056a..f6a6b42865fb 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c
@@ -47,11 +47,14 @@ int mtk_vcodec_init_dec_pm(struct mtk_vcodec_dev *mtkdev)
 		dec_clk->clk_info = devm_kcalloc(&pdev->dev,
 			dec_clk->clk_num, sizeof(*clk_info),
 			GFP_KERNEL);
-		if (!dec_clk->clk_info)
-			return -ENOMEM;
+		if (!dec_clk->clk_info) {
+			ret = -ENOMEM;
+			goto put_device;
+		}
 	} else {
 		mtk_v4l2_err("Failed to get vdec clock count");
-		return -EINVAL;
+		ret = -EINVAL;
+		goto put_device;
 	}
 
 	for (i = 0; i < dec_clk->clk_num; i++) {
@@ -60,19 +63,22 @@ int mtk_vcodec_init_dec_pm(struct mtk_vcodec_dev *mtkdev)
 			"clock-names", i, &clk_info->clk_name);
 		if (ret) {
 			mtk_v4l2_err("Failed to get clock name id = %d", i);
-			return ret;
+			goto put_device;
 		}
 		clk_info->vcodec_clk = devm_clk_get(&pdev->dev,
 			clk_info->clk_name);
 		if (IS_ERR(clk_info->vcodec_clk)) {
 			mtk_v4l2_err("devm_clk_get (%d)%s fail", i,
 				clk_info->clk_name);
-			return PTR_ERR(clk_info->vcodec_clk);
+			ret = PTR_ERR(clk_info->vcodec_clk);
+			goto put_device;
 		}
 	}
 
 	pm_runtime_enable(&pdev->dev);
-
+	return 0;
+put_device:
+	put_device(pm->larbvdec);
 	return ret;
 }
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_dec_pm()
  2020-10-09 12:37 [PATCH V2 0/7] patches to add missing put_device() call Yu Kuai
                   ` (3 preceding siblings ...)
  2020-10-09 12:38 ` [PATCH 4/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_dec_pm() Yu Kuai
@ 2020-10-09 12:38 ` Yu Kuai
  2020-10-09 12:38 ` [PATCH 6/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_enc_pm() Yu Kuai
  2020-10-09 12:38 ` [PATCH 7/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_enc_pm() Yu Kuai
  6 siblings, 0 replies; 9+ messages in thread
From: Yu Kuai @ 2020-10-09 12:38 UTC (permalink / raw)
  To: rick.chang, bin.liu, mchehab, matthias.bgg, tiffany.lin,
	andrew-ct.chen, tfiga, xia.jiang, hverkuil-cisco, jcliang,
	minghsiu.tsai
  Cc: linux-media, linux-arm-kernel, linux-mediatek, linux-kernel,
	yukuai3, yi.zhang

mtk_vcodec_release_dec_pm() will be called in two places:

a. mtk_vcodec_init_dec_pm() succeed while mtk_vcodec_probe() return error.
b. mtk_vcodec_dec_remove().

In both cases put_device() call is needed, since of_find_device_by_node()
was called in mtk_vcodec_init_dec_pm() previously.

Thus add put_devices() call in mtk_vcodec_release_dec_pm()

Fixes: 590577a4e525 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c
index f6a6b42865fb..ddee7046ce42 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec_pm.c
@@ -85,6 +85,7 @@ int mtk_vcodec_init_dec_pm(struct mtk_vcodec_dev *mtkdev)
 void mtk_vcodec_release_dec_pm(struct mtk_vcodec_dev *dev)
 {
 	pm_runtime_disable(dev->pm.dev);
+	put_device(dev->pm.larbvdec);
 }
 
 void mtk_vcodec_dec_pw_on(struct mtk_vcodec_pm *pm)
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_enc_pm()
  2020-10-09 12:37 [PATCH V2 0/7] patches to add missing put_device() call Yu Kuai
                   ` (4 preceding siblings ...)
  2020-10-09 12:38 ` [PATCH 5/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_dec_pm() Yu Kuai
@ 2020-10-09 12:38 ` Yu Kuai
  2020-10-09 12:38 ` [PATCH 7/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_enc_pm() Yu Kuai
  6 siblings, 0 replies; 9+ messages in thread
From: Yu Kuai @ 2020-10-09 12:38 UTC (permalink / raw)
  To: rick.chang, bin.liu, mchehab, matthias.bgg, tiffany.lin,
	andrew-ct.chen, tfiga, xia.jiang, hverkuil-cisco, jcliang,
	minghsiu.tsai
  Cc: linux-media, linux-arm-kernel, linux-mediatek, linux-kernel,
	yukuai3, yi.zhang

if of_find_device_by_node() succeed, mtk_vcodec_init_enc_pm() doesn't have
a corresponding put_device(). Thus add jump target to fix the exception
handling for this function implementation.

Fixes: 4e855a6efa54 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Encoder Driver")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 .../platform/mtk-vcodec/mtk_vcodec_enc_pm.c   | 26 ++++++++++++++-----
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
index ee22902aaa71..1a047c25679f 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
@@ -47,14 +47,16 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev)
 	node = of_parse_phandle(dev->of_node, "mediatek,larb", 1);
 	if (!node) {
 		mtk_v4l2_err("no mediatek,larb found");
-		return -ENODEV;
+		ret = -ENODEV;
+		goto put_larbvenc;
 	}
 
 	pdev = of_find_device_by_node(node);
 	of_node_put(node);
 	if (!pdev) {
 		mtk_v4l2_err("no mediatek,larb device found");
-		return -ENODEV;
+		ret = -ENODEV;
+		goto put_larbvenc;
 	}
 
 	pm->larbvenclt = &pdev->dev;
@@ -67,11 +69,14 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev)
 		enc_clk->clk_info = devm_kcalloc(&pdev->dev,
 			enc_clk->clk_num, sizeof(*clk_info),
 			GFP_KERNEL);
-		if (!enc_clk->clk_info)
-			return -ENOMEM;
+		if (!enc_clk->clk_info) {
+			ret = -ENOMEM;
+			goto put_larbvenclt;
+		}
 	} else {
 		mtk_v4l2_err("Failed to get venc clock count");
-		return -EINVAL;
+		ret = -EINVAL;
+		goto put_larbvenclt;
 	}
 
 	for (i = 0; i < enc_clk->clk_num; i++) {
@@ -80,17 +85,24 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev)
 			"clock-names", i, &clk_info->clk_name);
 		if (ret) {
 			mtk_v4l2_err("venc failed to get clk name %d", i);
-			return ret;
+			goto put_larbvenclt;
 		}
 		clk_info->vcodec_clk = devm_clk_get(&pdev->dev,
 			clk_info->clk_name);
 		if (IS_ERR(clk_info->vcodec_clk)) {
 			mtk_v4l2_err("venc devm_clk_get (%d)%s fail", i,
 				clk_info->clk_name);
-			return PTR_ERR(clk_info->vcodec_clk);
+			ret = PTR_ERR(clk_info->vcodec_clk);
+			goto put_larbvenclt;
 		}
 	}
 
+	return 0;
+
+put_larbvenclt:
+	put_device(pm->larbvenclt);
+put_larbvenc:
+	put_device(pm->larbvenc);
 	return ret;
 }
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 7/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_enc_pm()
  2020-10-09 12:37 [PATCH V2 0/7] patches to add missing put_device() call Yu Kuai
                   ` (5 preceding siblings ...)
  2020-10-09 12:38 ` [PATCH 6/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_enc_pm() Yu Kuai
@ 2020-10-09 12:38 ` Yu Kuai
  6 siblings, 0 replies; 9+ messages in thread
From: Yu Kuai @ 2020-10-09 12:38 UTC (permalink / raw)
  To: rick.chang, bin.liu, mchehab, matthias.bgg, tiffany.lin,
	andrew-ct.chen, tfiga, xia.jiang, hverkuil-cisco, jcliang,
	minghsiu.tsai
  Cc: linux-media, linux-arm-kernel, linux-mediatek, linux-kernel,
	yukuai3, yi.zhang

mtk_vcodec_release_enc_pm() will be called in two places:

a. mtk_vcodec_init_enc_pm() succeed while mtk_vcodec_probe() return error.
b. mtk_vcodec_enc_remove().

In both cases put_device() call is needed, since of_find_device_by_node()
was called in mtk_vcodec_init_enc_pm() previously.

Thus add put_devices() call in mtk_vcodec_release_enc_pm()

Signed-off-by: Yu Kuai <yukuai3@huawei.com>
---
 drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
index 1a047c25679f..3b7c54d6aa8f 100644
--- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
+++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc_pm.c
@@ -108,6 +108,8 @@ int mtk_vcodec_init_enc_pm(struct mtk_vcodec_dev *mtkdev)
 
 void mtk_vcodec_release_enc_pm(struct mtk_vcodec_dev *mtkdev)
 {
+	put_device(mtkdev->pm.larbvenclt);
+	put_device(mtkdev->pm.larbvenc);
 }
 
 
-- 
2.25.4


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/7] media: platform: add missing put_device() call in mtk_jpeg_probe()
  2020-10-09 12:37 ` [PATCH 2/7] media: platform: add missing put_device() call in mtk_jpeg_probe() Yu Kuai
@ 2020-10-30  9:46   ` Hans Verkuil
  0 siblings, 0 replies; 9+ messages in thread
From: Hans Verkuil @ 2020-10-30  9:46 UTC (permalink / raw)
  To: Yu Kuai, rick.chang, bin.liu, mchehab, matthias.bgg, tiffany.lin,
	andrew-ct.chen, tfiga, xia.jiang, jcliang, minghsiu.tsai
  Cc: linux-media, linux-arm-kernel, linux-mediatek, linux-kernel, yi.zhang

On 09/10/2020 14:37, Yu Kuai wrote:
> if mtk_jpeg_clk_init() succeed, mtk_jpeg_probe() doesn't have a
> corresponding put_device(). Thus add put_device() in jump target to fix
> the exception handling for this function implementation.
> 
> Fixes: b2f0d2724ba4 ("[media] vcodec: mediatek: Add Mediatek JPEG Decoder Driver")
> Signed-off-by: Yu Kuai <yukuai3@huawei.com>
> ---
>  drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> index 106543391c46..f0c412f96d61 100644
> --- a/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> +++ b/drivers/media/platform/mtk-jpeg/mtk_jpeg_core.c
> @@ -1436,6 +1436,7 @@ static int mtk_jpeg_probe(struct platform_device *pdev)
>  	v4l2_device_unregister(&jpeg->v4l2_dev);
>  
>  err_dev_register:
> +	put_device(jpeg->larb);
>  
>  err_clk_init:
>  
> 

This is too confusing since it is not obvious that this is the
counterpart of mtk_jpeg_clk_init. I think it would be much easier
to understand if you add a mtk_jpeg_clk_release() which does this
put_device, and call that new function both here and in mtk_jpeg_remove().

Regards,

	Hans

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-10-30  9:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-09 12:37 [PATCH V2 0/7] patches to add missing put_device() call Yu Kuai
2020-10-09 12:37 ` [PATCH 1/7] media: platform: add missing put_device() call in mtk_jpeg_clk_init() Yu Kuai
2020-10-09 12:37 ` [PATCH 2/7] media: platform: add missing put_device() call in mtk_jpeg_probe() Yu Kuai
2020-10-30  9:46   ` Hans Verkuil
2020-10-09 12:38 ` [PATCH 3/7] media: platform: add missing put_device() call in mtk_jpeg_remove() Yu Kuai
2020-10-09 12:38 ` [PATCH 4/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_dec_pm() Yu Kuai
2020-10-09 12:38 ` [PATCH 5/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_dec_pm() Yu Kuai
2020-10-09 12:38 ` [PATCH 6/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_init_enc_pm() Yu Kuai
2020-10-09 12:38 ` [PATCH 7/7] media: mtk-vcodec: add missing put_device() call in mtk_vcodec_release_enc_pm() Yu Kuai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).