Re: [PATCH v4 03/15] iio: temp: ltc2983: Use __free(fwnode_handle) to replace fwnode_handle_put() calls

Jonathan Cameron
2024-02-24T11:37:28Z

On Mon, 19 Feb 2024 14:52:51 +0100
Nuno Sá <noname.nuno@gmail.com> wrote:

> On Sat, 2024-02-17 at 16:42 +0000, Jonathan Cameron wrote:
> > From: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> >
> > This use of the new cleanup.h scope based freeing infrastructure allows
> > us to exit directly from error conditions and in the good path with
> > the reference obtained from fwnode_find_reference() (which may be an error
> > pointer) automatically released.
> >
> > Cc: Cosmin Tanislav <cosmin.tanislav@analog.com>
> > Cc: Nuno Sá <nuno.sa@analog.com>
> > Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
> > ---
> > v2: Move the declarations down to where they are assigned.
> > This both clearly associates the cleanup with the action that it
> > is cleaning up and avoid potential future missordering of cleanup.
> > ---
>
> This LGTM. Only comment is that in ltc2983_parse_dt() we do have a loop where we
> could make use of device_for_each_child_node_scoped(). It seems to me that
> change could be included in this patch.
>
> - Nuno Sá
>
>

True. Not sure how I missed that. I'll do that for v5 posting of remaining drivers.