Re: [PATCH RFT/RFC] mfd: cs42l43: setup true links with software nodes
From: Bartosz Golaszewski
Date: Thu Nov 20 2025 - 07:33:28 EST
On Thu, Nov 20, 2025 at 10:56 AM Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
>
> > Look at all the find_device_by_fwnode() functions we have everywhere.
>
> What do you mean, please?
>
> $ git grep -n -w find_device_by_fwnode | wc -l
> 0
>
I made up a placeholder name for all different variants of functions
finding devices of different types by fwnode.
> Even if you refer to *_find_device_by_fwnode(), still it's not everywhere,
> just in a dozen of modules.
>
> > The crux of the problem Charles identified is the fact that the
> > secondary fwnode is a field of struct fwnode_handle and not of a
> > struct device. This really doesn't make sense as we see where multiple
> > devices use a single "real" fwnode but want to have different
> > secondary software nodes.
> >
> > Moving the secondary fwnode to struct device would already help a lot
> > but if we're doing that then we may as well switch to a list of
> > fwnodes.
>
> They all should be an independent entity that can be part of the struct device
> but it's not obligatory relation ship.
>
> Again, device may have a backing fwnode, while fwnode might not have a struct
> device consumer.
>
I never said it must have one. Just that it's common and we do use this fact.
Bart