devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Devicetree Compiler
	<devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v3] checks: add chosen node checks
Date: Fri, 15 Dec 2017 14:16:16 +1100	[thread overview]
Message-ID: <20171215031616.GC7753@umbus.fritz.box> (raw)
In-Reply-To: <CAL_Jsq+M2jjKAstCmS8zPSf-SfFtq+vtKGYJtWvbJL9355L8cA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1991 bytes --]

On Thu, Dec 14, 2017 at 09:11:52PM -0600, Rob Herring wrote:
> On Thu, Dec 14, 2017 at 8:27 PM, David Gibson
> <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
> > On Thu, Dec 14, 2017 at 04:40:01PM -0600, Rob Herring wrote:
> >> Add some checks for /chosen node. These check that chosen is located at
> >> the root level and that bootargs and stdout-path properties are strings.
> >>
> >> Signed-off-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> >
> > Applied, thanks.
> >
> > One possible follow-on...
> >
> > [snip]
> >> +static void check_chosen_node_stdout_path(struct check *c, struct dt_info *dti,
> >> +                                       struct node *node)
> >> +{
> >> +     struct property *prop;
> >> +
> >> +     if (!streq(node->name, "chosen"))
> >> +             return;
> >> +
> >> +     prop = get_property(node, "stdout-path");
> >> +     if (!prop) {
> >> +             prop = get_property(node, "linux,stdout-path");
> >> +             if (!prop)
> >> +                     return;
> >> +             FAIL(c, dti, "Use 'stdout-path' instead of 'linux,stdout-path'");
> >> +     }
> >> +
> >> +     c->data = prop->name;
> >> +     check_is_string(c, dti, node);
> >
> > .. you could also check that it's actually a valid path to a node,
> > couldn't you?
> 
> Yes I thought of that, but it's often an alias. I didn't look closely,
> but I don't think that would work unless I add that additional
> lookup.

Ah, good point, you would need to check against aliases as well.  We
probably should have a helper that looks up a path, including alias
resolution (so both "/absolute/path" and "alias/path/from/alias").
Both forms are traditionally allowed in most contexts that accept a
path in OF.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

      parent reply	other threads:[~2017-12-15  3:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-14 22:40 [PATCH v3] checks: add chosen node checks Rob Herring
     [not found] ` <20171214224001.17298-1-robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-12-15  2:27   ` David Gibson
     [not found]     ` <20171215022754.GB7753-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2017-12-15  3:11       ` Rob Herring
     [not found]         ` <CAL_Jsq+M2jjKAstCmS8zPSf-SfFtq+vtKGYJtWvbJL9355L8cA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-12-15  3:16           ` David Gibson [this message]

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=20171215031616.GC7753@umbus.fritz.box \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=robh-DgEjT+Ai2ygdnm+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).