[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20230314115516.667-3-vaishnav.a@ti.com>
Date: Tue, 14 Mar 2023 17:25:05 +0530
From: Vaishnav Achath <vaishnav.a@...com>
To: <linux-media@...r.kernel.org>, <devicetree@...r.kernel.org>,
<mripard@...nel.org>, <mchehab@...nel.org>, <robh+dt@...nel.org>,
<krzysztof.kozlowski+dt@...aro.org>,
<laurent.pinchart@...asonboard.com>,
<sakari.ailus@...ux.intel.com>, <tomi.valkeinen@...asonboard.com>
CC: <linux-kernel@...r.kernel.org>, <bparrot@...com>,
<niklas.soderlund+renesas@...natech.se>, <j-luthra@...com>,
<devarsht@...com>, <praneeth@...com>, <u-kumar1@...com>,
<vigneshr@...com>, <nm@...com>, <martyn.welch@...labora.com>,
<vaishnav.a@...com>
Subject: [PATCH v7 02/13] media: cadence: csi2rx: Cleanup media entity properly
From: Pratyush Yadav <p.yadav@...com>
Call media_entity_cleanup() in probe error path and remove to make sure
the media entity is cleaned up properly.
Suggested-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Signed-off-by: Pratyush Yadav <p.yadav@...com>
Signed-off-by: Vaishnav Achath <vaishnav.a@...com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
---
(no changes since v6)
Changes in v6:
- Add Laurent's R-by.
Changes in v5:
- New in v5.
drivers/media/platform/cadence/cdns-csi2rx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/platform/cadence/cdns-csi2rx.c b/drivers/media/platform/cadence/cdns-csi2rx.c
index 2a23da6a0b8e..2547903f2e8e 100644
--- a/drivers/media/platform/cadence/cdns-csi2rx.c
+++ b/drivers/media/platform/cadence/cdns-csi2rx.c
@@ -471,6 +471,7 @@ static int csi2rx_probe(struct platform_device *pdev)
err_cleanup:
v4l2_async_nf_unregister(&csi2rx->notifier);
v4l2_async_nf_cleanup(&csi2rx->notifier);
+ media_entity_cleanup(&csi2rx->subdev.entity);
err_free_priv:
kfree(csi2rx);
return ret;
@@ -483,6 +484,7 @@ static int csi2rx_remove(struct platform_device *pdev)
v4l2_async_nf_unregister(&csi2rx->notifier);
v4l2_async_nf_cleanup(&csi2rx->notifier);
v4l2_async_unregister_subdev(&csi2rx->subdev);
+ media_entity_cleanup(&csi2rx->subdev.entity);
kfree(csi2rx);
return 0;
--
2.17.1
Powered by blists - more mailing lists