Re: [PATCH 3/4] media: rkisp1: use fwnode_graph_for_each_endpoint_scoped() to simplify code
From: Andy Shevchenko
Date: Tue Jun 23 2026 - 06:18:54 EST
On Mon, Jun 22, 2026 at 10:30:13AM -0400, Frank.Li@xxxxxxxxxxx wrote:
> Use fwnode_graph_for_each_endpoint_scoped() to simplify code.
>
> No functional changes.
...
> - fwnode_graph_for_each_endpoint(fwnode, ep) {
> + fwnode_graph_for_each_endpoint_scoped(fwnode, ep) {
> struct fwnode_handle *port;
> struct v4l2_fwnode_endpoint vep = { };
> struct rkisp1_sensor_async *rk_asd;
> @@ -286,7 +285,6 @@ static int rkisp1_subdev_notifier_register(struct rkisp1_device *rkisp1)
> }
>
> if (ret) {
> - fwnode_handle_put(ep);
> v4l2_async_nf_cleanup(ntf);
> return ret;
> }
In this case you can go further and actually replace all the
ret = -Exxx;
break;
with
v4l2_async_nf_cleanup(ntf);
return -Exx;
in the above loop.
but I assume the original is also fine as it's a common denominator for all of
them (and only one case has something in addition to that).
--
With Best Regards,
Andy Shevchenko