From: Markus Elfring <Markus.Elfring@web.de>
To: linux-media@vger.kernel.org, kernel-janitors@vger.kernel.org,
Eugen Hristev <eugen.hristev@collabora.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] media: microchip-csi2dc: Move a fwnode_handle_put() call into an if branch in csi2dc_of_parse()
Date: Fri, 1 Mar 2024 11:20:26 +0100 [thread overview]
Message-ID: <0f98e7de-4351-481f-86be-e573805c82f6@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Fri, 1 Mar 2024 11:11:44 +0100
Move a fwnode_handle_put() call into an if branch of this function
so that the control flow looks a bit safer directly.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/media/platform/microchip/microchip-csi2dc.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/media/platform/microchip/microchip-csi2dc.c b/drivers/media/platform/microchip/microchip-csi2dc.c
index fee73260bb1e..ed800a3bb268 100644
--- a/drivers/media/platform/microchip/microchip-csi2dc.c
+++ b/drivers/media/platform/microchip/microchip-csi2dc.c
@@ -595,12 +595,11 @@ static int csi2dc_of_parse(struct csi2dc_device *csi2dc,
output_fwnode = fwnode_graph_get_next_endpoint
(of_fwnode_handle(of_node), input_fwnode);
-
- if (output_fwnode)
+ if (output_fwnode) {
ret = v4l2_fwnode_endpoint_parse(output_fwnode,
&output_endpoint);
-
- fwnode_handle_put(output_fwnode);
+ fwnode_handle_put(output_fwnode);
+ }
if (!output_fwnode || ret) {
dev_info(csi2dc->dev,
--
2.44.0
reply other threads:[~2024-03-01 10:20 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=0f98e7de-4351-481f-86be-e573805c82f6@web.de \
--to=markus.elfring@web.de \
--cc=eugen.hristev@collabora.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/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
all inboxes | Powered by JetHome®