Re: [PATCH 2/2][resend] OF: add for_each_port_of_node()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Rob

> > -       for_each_endpoint_of_node(node, endpoint) {
> > -               if (endpoint == ep)
> > +       for_each_port_of_node(node, p) {
> > +               if (port == p)
> >                         id = i;
> >                 i++;
> >         }
> 
> This is fragile because it assumes 0-N port numbering. While that's
> usually true, it's not guaranteed.
> 
> Just add a of_graph_get_port_id() that reads and returns 'reg' value
> or 0 if no 'reg'. Or just use of_graph_parse_endpoint().

OK, will think about this.
How about [1/2] patch ? Is it good or not ?

Best regards
---
Kuninori Morimoto




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux