[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20231009-upstream_csi-v10-4-330aaed24c5d@ti.com>
Date: Mon, 9 Oct 2023 18:39:30 +0530
From: Jai Luthra <j-luthra@...com>
To: Mauro Carvalho Chehab <mchehab@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
Conor Dooley <conor+dt@...nel.org>,
Sakari Ailus <sakari.ailus@...ux.intel.com>,
Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
CC: <linux-media@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<devicetree@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Maxime Ripard <mripard@...nel.org>,
<niklas.soderlund+renesas@...natech.se>,
Benoit Parrot <bparrot@...com>,
Vaishnav Achath <vaishnav.a@...com>,
Vignesh Raghavendra <vigneshr@...com>, <nm@...com>,
<devarsht@...com>, <j-luthra@...com>, <a-bhatia1@...com>,
Martyn Welch <martyn.welch@...labora.com>,
Julien Massot <julien.massot@...labora.com>
Subject: [PATCH v10 04/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>
Tested-by: Julien Massot <julien.massot@...labora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@...asonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
Reviewed-by: Maxime Ripard <mripard@...nel.org>
Signed-off-by: Jai Luthra <j-luthra@...com>
---
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 64e472ca3594..399b2f800dc4 100644
--- a/drivers/media/platform/cadence/cdns-csi2rx.c
+++ b/drivers/media/platform/cadence/cdns-csi2rx.c
@@ -547,6 +547,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;
@@ -559,6 +560,7 @@ static void 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);
}
--
2.42.0
Powered by blists - more mailing lists