mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list@gmail.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
	Pantelis Antoniou <panto@antoniou-consulting.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 4/4] of: improve reporting invalid overlay target path
Date: Mon, 12 Feb 2018 12:51:05 -0800	[thread overview]
Message-ID: <a97ad5c3-eb7e-4f94-d17a-6a1a5404fb56@gmail.com> (raw)
In-Reply-To: <CAMuHMdUnkdtHnbSVM7p4756OQzq24N8=g8==s-6yKLAgki+LyA@mail.gmail.com>

On 02/12/18 01:00, Geert Uytterhoeven wrote:
> Hi Frank,
> 
> On Mon, Feb 12, 2018 at 9:51 AM,  <frowand.list@gmail.com> wrote:
>> From: Frank Rowand <frank.rowand@sony.com>
>>
>> Errors while developing the patch to create of_overlay_fdt_apply()
>> exposed inadequate error messages to debug problems when overlay
>> devicetree fragment nodes contain an invalid target path.  Improve
>> the messages in find_target_node() to remedy this.
>>
>> Signed-off-by: Frank Rowand <frank.rowand@sony.com>
> 
> Thanks for your patch!
> 
>> --- a/drivers/of/overlay.c
>> +++ b/drivers/of/overlay.c
>> @@ -488,17 +488,26 @@ static int build_changeset(struct overlay_changeset *ovcs)
>>   */
>>  static struct device_node *find_target_node(struct device_node *info_node)
>>  {
>> +       struct device_node *node;
>>         const char *path;
>>         u32 val;
>>         int ret;
>>
>>         ret = of_property_read_u32(info_node, "target", &val);
>> -       if (!ret)
>> -               return of_find_node_by_phandle(val);
>> +       if (!ret) {
>> +               node = of_find_node_by_phandle(val);
>> +               if (!node)
>> +                       pr_err("target node find by phandle failed\n");
> 
> Do you want to print the actual node, cfr. below?

That seems like a good idea.  The name printed below is the (short) node
name of the fragment, which seems useful.

Will do, but will remove the pointer to the node, which is more of an
internal debugging detail.


>> +               return node;
>> +       }
>>
>>         ret = of_property_read_string(info_node, "target-path", &path);
>> -       if (!ret)
>> -               return of_find_node_by_path(path);
>> +       if (!ret) {
>> +               node =  of_find_node_by_path(path);
>> +               if (!node)
>> +                       pr_err("target node find by path failed\n");
> 
> Likewise.

Will do.


>> +               return node;
>> +       }
>>
>>         pr_err("Failed to find target for node %p (%s)\n",
>>                 info_node, info_node->name);
> 
> This one prints more info.
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                 -- Linus Torvalds
> 

      reply	other threads:[~2018-02-12 20:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-12  8:51 [PATCH v2 0/4] of: change overlay apply input data from unflattened frowand.list
2018-02-12  8:51 ` [PATCH v2 1/4] of: change overlay apply input data from unflattened to FDT frowand.list
2018-02-12  8:51 ` [PATCH v2 2/4] of: Documentation: of_overlay_apply() replaced by of_overlay_fdt_apply() frowand.list
2018-02-12  8:51 ` [PATCH v2 3/4] of: convert unittest overlay devicetree source to sugar syntax frowand.list
2018-02-12  8:51 ` [PATCH v2 4/4] of: improve reporting invalid overlay target path frowand.list
2018-02-12  9:00   ` Geert Uytterhoeven
2018-02-12 20:51     ` Frank Rowand [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=a97ad5c3-eb7e-4f94-d17a-6a1a5404fb56@gmail.com \
    --to=frowand.list@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=panto@antoniou-consulting.com \
    --cc=robh+dt@kernel.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

all inboxes | Powered by JetHome®