lkml.org 
[lkml]   [2022]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [net-next: PATCH v2 5/8] device property: introduce fwnode_dev_node_match
On Fri, Jul 15, 2022 at 10:36:29PM +0300, Andy Shevchenko wrote:
> On Fri, Jul 15, 2022 at 10:50:09AM +0200, Marcin Wojtas wrote:
> > This patch adds a new generic routine fwnode_dev_node_match
> > that can be used e.g. as a callback for class_find_device().
> > It searches for the struct device corresponding to a
> > struct fwnode_handle by iterating over device and
> > its parents.
>
> Implementation
> 1) misses the word 'parent';
> 2) located outside of the group of fwnode APIs operating on parents.
>
> I would suggest to rename to fwnode_get_next_parent_node() and place
> near to fwnode_get_next_parent_dev() (either before or after, where
> it makes more sense).

And matching function will be after that:

return fwnode_get_next_parent_node(...) != NULL;

Think about it. Maybe current solution is good enough, just needs better
naming (fwnode_match_parent_node()? Dunno).

P.S. Actually _get maybe misleading as we won't bump reference counting,
rather _find?

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2022-07-15 21:43    [W:0.056 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site