media: rzg2l-csi2: Use common error handling code in rzg2l_csi2_parse_dt()
Subsystems (3)
PATCH 1/1 media: rzg2l-csi2: Use common error handling code in rzg2l_csi2_parse_dt()
From: Markus Elfring <[email protected]>
Date: Fri, 1 Mar 2024 14:02:22 +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 <[email protected]>
--- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +3 -2
@@ -671,12 +671,13 @@ static int rzg2l_csi2_parse_dt(struct rzg2l_csi2 *csi2) ret =v4l2_fwnode_endpoint_parse (ep, &v4l2_ep);if (ret) {dev_err (csi2->dev,"Could not parse v4l2 endpoint\n" ); -fwnode_handle_put (ep); -return -EINVAL ; + ret = -EINVAL ; + goto put_fwnode_ep; } ret =rzg2l_csi2_parse_v4l2 (csi2, &v4l2_ep);if (ret) { +put_fwnode_ep:fwnode_handle_put (ep);return ret; }
--
2.44.0
Laurent Pinchart
NAKQuoted 7 lines · Markus Elfring
From: Markus Elfring <[email protected]>
Date: Fri, 1 Mar 2024 14:02:22 +0100Add 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 <[email protected]>
Just in case someone may be tempted to apply this:
NAK
Markus, don't bother replying to this e-mail, I will delete your reply without reading it.
Quoted 28 lines
--- drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/media/platform/renesas/rzg2l-cru/rzg2l-csi2.c +3
-3@@ -671,12 +671,13 @@ static int rzg2l_csi2_parse_dt(struct rzg2l_csi2 *csi2) ret =v4l2_fwnode_endpoint_parse (ep, &v4l2_ep);if (ret) {dev_err (csi2->dev,"Could not parse v4l2 endpoint\n" ); -fwnode_handle_put (ep); -return -EINVAL ; + ret = -EINVAL ; + goto put_fwnode_ep; } ret =rzg2l_csi2_parse_v4l2 (csi2, &v4l2_ep);if (ret) { +put_fwnode_ep:fwnode_handle_put (ep);return ret; } --2.44.0
Signature · 3 lines
Regards, Laurent Pinchart