Re: [RFC 1/3] of: Migrate of_find_node_by_name() users to for_each_node_by_name()

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

 




On Thu, Jun 26, 2014 at 1:56 PM, Grant Likely <grant.likely@xxxxxxxxxx> wrote:
> On Thu, Jun 26, 2014 at 7:22 PM, Rob Herring <robherring2@xxxxxxxxx> wrote:
>> On Thu, Jun 26, 2014 at 11:03 AM, Grant Likely <grant.likely@xxxxxxxxxx> wrote:
>>> On Thu, 5 Jun 2014 12:48:54 -0500, Rob Herring <rob.herring@xxxxxxxxxx> wrote:
>>>> On Thu, Jun 5, 2014 at 10:43 AM, Grant Likely <grant.likely@xxxxxxxxxx> wrote:
>>>> > There are a bunch of users open coding the for_each_node_by_name() by
>>>> > calling of_find_node_by_name() directly instead of using the macro. This
>>>> > is getting in the way of some cleanups, and the possibility of removing
>>>> > of_find_node_by_name() entirely. Clean it up so that all the users are
>>>> > consistent.
>>>> >
>>>> > Signed-off-by: Grant Likely <grant.likely@xxxxxxxxxx>
>>>> > ---
>>>> >  arch/powerpc/platforms/powermac/feature.c  | 20 +++++---------------
>>>> >  arch/powerpc/platforms/powermac/pci.c      |  2 +-
>>>> >  arch/powerpc/platforms/powermac/smp.c      |  2 +-
>>>> >  arch/powerpc/platforms/powermac/udbg_adb.c |  2 +-
>>>> >  arch/powerpc/platforms/pseries/setup.c     |  3 +--
>>>> >  drivers/cpufreq/pmac64-cpufreq.c           |  3 +--
>>>> >  drivers/edac/cell_edac.c                   |  3 +--
>>>> >  drivers/pci/hotplug/rpaphp_core.c          |  4 ++--
>>>> >  drivers/tty/serial/pmac_zilog.c            |  9 +++------
>>>> >  sound/ppc/pmac.c                           |  6 +++---
>>>> >  10 files changed, 19 insertions(+), 35 deletions(-)
>>>> >
>>>> > diff --git a/arch/powerpc/platforms/powermac/feature.c b/arch/powerpc/platforms/powermac/feature.c
>>>> > index 63d82bbc05e9..39e1d163c427 100644
>>>> > --- a/arch/powerpc/platforms/powermac/feature.c
>>>> > +++ b/arch/powerpc/platforms/powermac/feature.c
>>>> > @@ -2805,25 +2805,20 @@ set_initial_features(void)
>>>> >                 /* Enable GMAC for now for PCI probing. It will be disabled
>>>> >                  * later on after PCI probe
>>>> >                  */
>>>> > -               np = of_find_node_by_name(NULL, "ethernet");
>>>> > -               while(np) {
>>>> > +               for_each_node_by_name(np, "ethernet")
>>>> >                         if (of_device_is_compatible(np, "K2-GMAC"))
>>>>
>>>> Can't for_each_compatible_node be used here instead?
>>>
>>> Not easily without changing the behaviour. It would need to then check
>>> the name inside the block.
>>
>> Why would it change behavior? If the compatible string matches, do you
>> really have cases where the node name is not "ethernet"? I don't
>> believe it's the kernel's job to validate DT bindings.
>
> Yes, there are actually some bindings that have the same compatible
> property but behaviour changes based on node name! I don't want to do
> the legwork to figure out if these are in that group. Someone else can
> do that job.

Well, that's just wrong.

Rob
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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