mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely@linaro.org>
To: Kevin Hao <haokexin@gmail.com>, Sachin Kamat <sachin.kamat@linaro.org>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>,
	linux-samsung-soc <linux-samsung-soc@vger.kernel.org>
Subject: Re: [PATCH v4 0/4] Bugfix for of_match_node ordering
Date: Thu, 20 Feb 2014 11:53:51 +0000	[thread overview]
Message-ID: <20140220115351.0DF7BC4050F@trevor.secretlab.ca> (raw)
In-Reply-To: <20140220101240.GA3745@pek-khao-d1.corp.ad.wrs.com>

On Thu, 20 Feb 2014 18:12:40 +0800, Kevin Hao <haokexin@gmail.com> wrote:
> On Thu, Feb 20, 2014 at 02:09:08PM +0530, Sachin Kamat wrote:
> > Hi Grant,
> > 
> > I observe the following boot failure with today's (next-20140220) linux-next
> > tree on Exynos based boards with the default exynos_defconfig.
> 
> Does this help?

I've merged this in. I could get my unicore test platform to fail to
boot by turning on lock debugging. I'll leave that option on from now
one.

I've pushed this out to the following branch. Please test and report. It
will also be picked up by linux-next tomorrow.

git://git.secretlab.ca/git/linux devicetree/merge

> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 8a27fc907ab6..9cc893530b9a 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -381,12 +381,16 @@ static int __of_device_is_compatible(const struct device_node *device,
>  
>  	/* Compatible match has highest priority */
>  	if (compat && compat[0]) {
> -		of_property_for_each_string(device, "compatible", prop, cp) {
> +		prop = __of_find_property(device, "compatible", NULL);
> +		if (!prop)
> +			return 0;

The above 2 lines are unnecessary. of_prop_next_string() will return
NULL if prop is NULL.

g.

> +
> +		for (cp = of_prop_next_string(prop, NULL); cp;
> +				cp = of_prop_next_string(prop, cp), index++) {
>  			if (of_compat_cmp(cp, compat, strlen(compat)) == 0) {
>  				score = INT_MAX/2 - (index << 2);
>  				break;
>  			}
> -			index++;
>  		}
>  		if (!score)
>  			return 0;
> 
> 
> Thanks,
> Kevin


  parent reply	other threads:[~2014-02-20 11:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19 14:14 Grant Likely
     [not found] ` < 1392819290-1044-3-git-send-email-grant.likely@linaro.org>
     [not found] ` < CAK9yfHwwmZkFMRvxsxjBAfUbVXU3V+iPFDZO=DwQsFvJ3NQyKA@mail.gmail.com>
2014-02-19 14:14 ` [PATCH v4 1/4] Revert "of: search the best compatible match first in __of_match_node()" Grant Likely
2014-02-19 14:14 ` [PATCH v4 2/4] of: reimplement the matching method for __of_match_node() Grant Likely
2014-02-19 14:54   ` Rob Herring
2014-02-19 15:34     ` Grant Likely
2014-02-19 14:14 ` [PATCH v4 3/4] of: Move testcase FDT data into drivers/of Grant Likely
2014-02-19 14:14 ` [PATCH v4 4/4] of: Add self test for of_match_node() Grant Likely
2014-02-20  8:39 ` [PATCH v4 0/4] Bugfix for of_match_node ordering Sachin Kamat
2014-02-20 10:12   ` Kevin Hao
2014-02-20 10:27     ` Sachin Kamat
2014-02-20 10:55       ` Kevin Hao
2014-02-20 11:13         ` Sachin Kamat
2014-02-20 11:53     ` Grant Likely [this message]
2014-02-20 11:29   ` Grant Likely
2014-02-21  1:22     ` Sören Brinkmann

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=20140220115351.0DF7BC4050F@trevor.secretlab.ca \
    --to=grant.likely@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=haokexin@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=sachin.kamat@linaro.org \
    --cc=sebastian.hesselbarth@gmail.com \
    /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®