[PATCH] media: microchip-csi2dc: Move a fwnode_handle_put() call into an if branch in csi2dc_of_parse()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxxxxxxxxxxx>
---
 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






[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux