On Tue, Oct 08, 2024 at 06:10:27PM +0200, Javier Carrasco wrote: > Introduce the scoped variant of the > fwnode_for_each_available_child_node() to automatically decrement the > child's refcount when it goes out of scope, removing the need for > explicit calls to fwnode_handle_put(). ... > +#define fwnode_for_each_available_child_node_scoped(fwnode, child) \ > + for (struct fwnode_handle *child __free(fwnode_handle) = \ > + fwnode_get_next_available_child_node(fwnode, NULL); child; \ > + child = fwnode_get_next_available_child_node(fwnode, child)) I like the wrapping you have done here. Can you align the device_for_each_child_node_scoped() to follow your variant? (probably in an additional patch) For this one Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx> -- With Best Regards, Andy Shevchenko