public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] media: rcar-csi2: Use common error handling code in rcsi2_parse_dt()
@ 2024-03-01 12:10 Markus Elfring
  2024-03-01 13:05 ` Geert Uytterhoeven
  2024-03-01 13:15 ` [PATCH] " Laurent Pinchart
  0 siblings, 2 replies; 11+ messages in thread
From: Markus Elfring @ 2024-03-01 12:10 UTC (permalink / raw)
  To: linux-renesas-soc, linux-media, kernel-janitors,
	Mauro Carvalho Chehab, Niklas Söderlund
  Cc: LKML

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 1 Mar 2024 13:02:18 +0100

Add a label so that a bit of exception handling can be better reused
in an if branch of this function implementation.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/media/platform/renesas/rcar-csi2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/media/platform/renesas/rcar-csi2.c b/drivers/media/platform/renesas/rcar-csi2.c
index 582d5e35db0e..621c92c31965 100644
--- a/drivers/media/platform/renesas/rcar-csi2.c
+++ b/drivers/media/platform/renesas/rcar-csi2.c
@@ -1388,12 +1388,13 @@ static int rcsi2_parse_dt(struct rcar_csi2 *priv)
 	ret = v4l2_fwnode_endpoint_parse(ep, &v4l2_ep);
 	if (ret) {
 		dev_err(priv->dev, "Could not parse v4l2 endpoint\n");
-		fwnode_handle_put(ep);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto put_fwnode_ep;
 	}

 	ret = rcsi2_parse_v4l2(priv, &v4l2_ep);
 	if (ret) {
+put_fwnode_ep:
 		fwnode_handle_put(ep);
 		return ret;
 	}
--
2.44.0


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

end of thread, other threads:[~2024-03-16 12:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-01 12:10 [PATCH] media: rcar-csi2: Use common error handling code in rcsi2_parse_dt() Markus Elfring
2024-03-01 13:05 ` Geert Uytterhoeven
2024-03-01 13:42   ` Dan Carpenter
2024-03-03  8:36     ` Markus Elfring
2024-03-04 10:48     ` Sakari Ailus
2024-03-04 11:16       ` Dan Carpenter
2024-03-16  9:46         ` Niklas Söderlund
2024-03-16  9:54           ` Dan Carpenter
2024-03-16 10:18             ` Niklas Söderlund
2024-03-16 12:21             ` Markus Elfring
2024-03-01 13:15 ` [PATCH] " Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox