From: Grant Likely <grant.likely@linaro.org>
To: Laurentiu Tudor <b10716@freescale.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Cc: Laurentiu Tudor <Laurentiu.Tudor@freescale.com>
Subject: Re: [PATCH] of: make sure of_alias is initialized before accessing it
Date: Mon, 08 Sep 2014 14:29:56 +0100 [thread overview]
Message-ID: <20140908132956.646FEC40AE5@trevor.secretlab.ca> (raw)
In-Reply-To: <53FDE6A3.3080303@freescale.com>
On Wed, 27 Aug 2014 17:09:39 +0300, Laurentiu Tudor <b10716@freescale.com> wrote:
> Simply swap of_alias and of_chosen initialization so
> that of_alias ends up read first. This must be done
> because it is accessed couple of lines below when
> trying to initialize the of_stdout using the alias
> based legacy method.
>
> [Fixes a752ee5 - tty: Update hypervisor tty drivers to
> use core stdout parsing code]
>
> Signed-off-by: Laurentiu Tudor <Laurentiu.Tudor@freescale.com>
> Cc: Grant Likely <grant.likely@linaro.org>
> ---
> drivers/of/base.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index d8574ad..52f8506 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -1847,6 +1847,10 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
> {
> struct property *pp;
>
> + of_aliases = of_find_node_by_path("/aliases");
> + if (!of_aliases)
> + return;
> +
> of_chosen = of_find_node_by_path("/chosen");
> if (of_chosen == NULL)
> of_chosen = of_find_node_by_path("/chosen@0");
> @@ -1862,10 +1866,6 @@ void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align))
> of_stdout = of_find_node_by_path(name);
> }
>
> - of_aliases = of_find_node_by_path("/aliases");
> - if (!of_aliases)
> - return;
> -
Close, but not quite. The 'if (!of_aliases)' test should not be moved.
Only the search for of_find_node_by_path(). I've fixed it up and
applied.
g.
> for_each_property_of_node(of_aliases, pp) {
> const char *start = pp->name;
> const char *end = start + strlen(start);
> --
> 1.8.3.1
next prev parent reply other threads:[~2014-09-08 13:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-27 14:09 Laurentiu Tudor
2014-09-08 13:29 ` Grant Likely [this message]
2014-09-08 14:13 ` Laurentiu Tudor
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=20140908132956.646FEC40AE5@trevor.secretlab.ca \
--to=grant.likely@linaro.org \
--cc=Laurentiu.Tudor@freescale.com \
--cc=b10716@freescale.com \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.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®