devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Rob Herring <rob.herring-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [RFC 1/3] of: Migrate of_find_node_by_name() users to for_each_node_by_name()
Date: Thu, 26 Jun 2014 14:00:05 -0500	[thread overview]
Message-ID: <CAL_JsqLUjcxHrHctfVe7M79=8MpUCYq1cBhfsoXVzrBoxECwvw@mail.gmail.com> (raw)
In-Reply-To: <CACxGe6tiiNvz9VCq=enTWMGDBUS_0gsDZh2DvzpVP5itQtiRpA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, Jun 26, 2014 at 1:56 PM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
> On Thu, Jun 26, 2014 at 7:22 PM, Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On Thu, Jun 26, 2014 at 11:03 AM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>>> On Thu, 5 Jun 2014 12:48:54 -0500, Rob Herring <rob.herring-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote:
>>>> On Thu, Jun 5, 2014 at 10:43 AM, Grant Likely <grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 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-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
>>>> > ---
>>>> >  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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-06-26 19:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-05 15:43 [RFC 0/3] of: Refactor device tree linked lists Grant Likely
     [not found] ` <1401983021-13829-1-git-send-email-grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-06-05 15:43   ` [RFC 1/3] of: Migrate of_find_node_by_name() users to for_each_node_by_name() Grant Likely
     [not found]     ` <1401983021-13829-2-git-send-email-grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-06-05 17:48       ` Rob Herring
     [not found]         ` <CABGGisx=fhp1P68M+9aQUTzi6Bp+PnXK7Xq_TQ+=87AkGCZvwQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-26 16:03           ` Grant Likely
     [not found]             ` <20140626160345.6613CC41060-WNowdnHR2B42iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2014-06-26 18:22               ` Rob Herring
     [not found]                 ` <CAL_JsqKDsdqd3PJ0gwvESMER=Nxi1us55pKWDhTuZtwgjo_MGA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-26 18:56                   ` Grant Likely
     [not found]                     ` <CACxGe6tiiNvz9VCq=enTWMGDBUS_0gsDZh2DvzpVP5itQtiRpA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-26 19:00                       ` Rob Herring [this message]
     [not found]                         ` <CAL_JsqLUjcxHrHctfVe7M79=8MpUCYq1cBhfsoXVzrBoxECwvw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-06-26 19:02                           ` Grant Likely
2014-06-05 15:43   ` [RFC 2/3] of: Replace custom linked list with list_head Grant Likely
2014-06-05 15:43   ` [RFC 3/3] of: Refactor device_node child list to use list_head Grant Likely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAL_JsqLUjcxHrHctfVe7M79=8MpUCYq1cBhfsoXVzrBoxECwvw@mail.gmail.com' \
    --to=robherring2-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=grant.likely-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=rob.herring-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).