Re: [PATCH v3 1/4] device property: Introduce fwnode_graph_for_each_endpoint_scoped()
From: Danilo Krummrich
Date: Tue Sep 08 2026 - 09:33:29 EST
On Tue Jul 28, 2026 at 8:27 AM CEST, Sakari Ailus wrote:
> Hi Rafael, Danilo,
>
> Can we merge this via the media tree (assuming you're fine with the
> change)?
Acked-by: Danilo Krummrich <dakr@xxxxxxxxxx>
> On Thu, Jun 25, 2026 at 10:17:21AM -0400, Frank.Li@xxxxxxxxxxx wrote:
>> From: Frank Li <Frank.Li@xxxxxxx>
>>
>> Similar to recently propose for_each_child_of_node_scoped() this new
>> version of the loop macro instantiates a new local struct fwnode_handle *
>> that uses the __free(fwnode_handle) auto cleanup handling so that if a
>> reference to a node is held on early exit from the loop the reference will
>> be released. If the loop runs to completion, the child pointer will be NULL
>> and no action will be taken.
>>
>> The reason this is useful is that it removes the need for
>> fwnode_handle_put() on early loop exits. If there is a need to retain the
>> reference, then return_ptr(child) or no_free_ptr(child) may be used to
>> safely disable the auto cleanup.
>>
>> Reviewed-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>> Reviewed-by: Guoniu Zhou <guoniu.zhou@xxxxxxxxxxx>
>> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>
>> Signed-off-by: Frank Li <Frank.Li@xxxxxxx>