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

Nuno Sá
2024-02-19T13:49:32Z

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á