Re: [PATCH 2/2] hwmon: (ltc2992) use fwnode_for_each_available_child_node_scoped()

From: Andy Shevchenko
Date: Wed May 22 2024 - 07:37:49 EST


On Wed, May 22, 2024 at 11:18:08AM +0200, Javier Carrasco wrote:
> The error path from a zero value of the "shunt-resistor-micro-ohms"
> property does not decrement the refcount of the child node.
>
> Instead of adding the missing fwnode_handle_put(), a safer fix for
> future modifications is using the _scoped version of the macro,
> which removes the need for fwnode_handle_put() in all error paths.

Not sure if the fix for easier backporting is better, up to Guenter and Greg.
If the above is the case, you will need

1) backportable fix;
2) the patch 1 as of this series;
3) conversion patch.

> The macro defines the child node internally, which removes the need for
> the current child node declaration as well.

FWIW,
Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
in case it will go the current way.

--
With Best Regards,
Andy Shevchenko