Re: [PATCH v2] software_node: Add support for fwnode_graph*() family of functions

From: Andy Shevchenko
Date: Fri Sep 18 2020 - 08:42:09 EST


On Fri, Sep 18, 2020 at 10:57:41AM +0300, Sakari Ailus wrote:
> On Fri, Sep 18, 2020 at 08:46:52AM +0100, Dan Scally wrote:
> > On 18/09/2020 08:34, Sakari Ailus wrote:
> > > On Fri, Sep 18, 2020 at 07:49:31AM +0100, Dan Scally wrote:

...

> > > The secondary field is there for this purpose. But it may be not all fwnode
> > > interface functions operate on fwnode->secondary?
> > Let me test it; it might just require some changes to
> > software_node_graph_get_port_parent() to check if the parent fwnode is a
> > secondary, and if it is to return the primary instead.
>
> Ah, indeed. I forgot this part. I wonder if it'd cause issues to return the
> primary if you've got the secondary swnode.
>
> Heikki, any idea?
>
> Code elsewhere (e.g. V4L2 fwnode framework + drivers) assume a device is
> identified by a single fwnode, not two --- currently the swnode graph
> function returning port parent returns the secondary so there's no match
> with the primary fwnode.

At least recently I made a patch (114dbb4fa7c4) to support secondary in
device_get_next_child_node(). I'm not sure how we can do it on fwnode level.

And now I'm thinking that above mentioned change is just particular case, but
doesn't really move entire device property API to that.

--
With Best Regards,
Andy Shevchenko