lkml.org 
[lkml]   [2022]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC 02/10] property: add fwnode_get_match_data()
Le Mon, 21 Feb 2022 19:46:12 +0200,
Andy Shevchenko <andriy.shevchenko@linux.intel.com> a écrit :

> On Mon, Feb 21, 2022 at 05:26:44PM +0100, Clément Léger wrote:
> > Add fwnode_get_match_data() which is meant to be used as
> > device_get_match_data for fwnode_operations.
>
> ...
>
> > +const void *fwnode_get_match_data(const struct fwnode_handle *fwnode,
> > + const struct device *dev)
> > +{
> > + const struct of_device_id *match;
> > +
> > + match = fwnode_match_node(fwnode, dev->driver->of_match_table);
> > + if (!match)
> > + return NULL;
> > +
> > + return match->data;
> > +}
>
> It's OF-centric API, why it has fwnode prefix? Can it leave in drivers/of instead?
>
>

The idea is to allow device with a software_node description to match
with the content of the of_match_table. Without this, we would need a
new type of match table that would probably duplicates part of the
of_match_table to be able to match software_node against a driver.
I did not found an other way to do it without modifying drivers
individually to support software_nodes.

--
Clément Léger,
Embedded Linux and Kernel engineer at Bootlin
https://bootlin.com

\
 
 \ /
  Last update: 2022-02-22 09:21    [W:0.107 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site