lkml.org 
[lkml]   [2022]   [Feb]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 03/10] base: swnode: use fwnode_get_match_data()
On Wed, Feb 23, 2022 at 04:15:35PM +0100, Clément Léger wrote:
> Le Wed, 23 Feb 2022 17:05:22 +0200,
> Sakari Ailus <sakari.ailus@linux.intel.com> a écrit :
>
> > > const void *device_get_match_data(struct device *dev)
> > > {
> > > if (!fwnode_has_op(fwnode, device_get_match_data)
> > > return fwnode_get_match_data(dev);
> > > return fwnode_call_ptr_op(dev_fwnode(dev),device_get_match_data, dev);
> > > }
> > >
> > > But I thought it was more convenient to do it by setting the
> > > .device_get_match_data field of software_node operations.
> >
> > Should this function be called e.g. software_node_get_match_data() instead,
> > as it seems to be specific to software nodes?
>
> Hi Sakari,
>
> You are right, since the only user of this function currently is the
> software_node operations, then I should rename it and move it to
> swnode.c maybe.

It might be also fit to be used in OF, based on how it looks like.

But currently the original naming makes it seem an fwnode property API
function and that is misleading. I'd move this to swnode.c now with a new
software node specific name, and rethink the naming matter if there would
seem to be possibilities for code re-use.

--
Sakari Ailus

\
 
 \ /
  Last update: 2022-02-23 16:25    [W:0.057 / U:0.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site