public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-renesas-soc@vger.kernel.org, linux-media@vger.kernel.org,
	kernel-janitors@vger.kernel.org,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	"Niklas Söderlund" <niklas.soderlund@ragnatech.se>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] media: rcar-csi2: Use common error handling code in rcsi2_parse_dt()
Date: Fri, 1 Mar 2024 13:10:15 +0100	[thread overview]
Message-ID: <8b4203dc-bc0a-4c00-8862-e2d0ed6e346b@web.de> (raw)

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


             reply	other threads:[~2024-03-01 12:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-01 12:10 Markus Elfring [this message]
2024-03-01 13:05 ` [PATCH] media: rcar-csi2: Use common error handling code in rcsi2_parse_dt() 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8b4203dc-bc0a-4c00-8862-e2d0ed6e346b@web.de \
    --to=markus.elfring@web.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund@ragnatech.se \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox