Re: [PATCH 5/9] of: property: implement the .property_get_names() fwnode operation
From: Andy Shevchenko
Date: Mon Nov 09 2026 - 12:32:06 EST
On Mon, Nov 09, 2026 at 02:07:46PM +0100, Bartosz Golaszewski wrote:
> On Wed, Nov 04, 2026 at 11:21:15PM +0200, Andy Shevchenko wrote:
> > On Wed, Nov 04, 2026 at 03:03:47PM +0100, Bartosz Golaszewski wrote:
...
> > > + for_each_property_of_node(node, prop)
> > > + count++;
> >
> > Hmm... Don't we have a helper for that already?
>
> I haven't found one. Though I'm thinking that maybe
> fwnode_property_get_names() with props == NULL could serve that purpose?
> Possibly wrapped in a static inline fwnode_property_count()? Would
> anyone use it though?
I haven't found any users for this. Most of the current ones of
for_each_property_of_node() are filtering by property name.
...
> > > + names[i] = kstrdup(prop->name, GFP_KERNEL);
> >
> > Can property be statically defined somewhere? We might want to also optimize
> > these duplications with const variant (here or elsewhere, for fwnode generic
> > path, I believe).
>
> Please rephrase because I'm not quite following what you're saying.
Can prop->name come from something that is declared as
static const ... foo = {
... .name = "bar";
};
?
--
With Best Regards,
Andy Shevchenko