All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <rob.herring@calxeda.com>
To: Wojciech Baranowski <baranowski@chromium.org>
Cc: devicetree-discuss@lists.ozlabs.org,
	Grant Likely <grant.likely@secretlab.ca>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] of/platform: Allow missing address for dev name lookup
Date: Fri, 18 Nov 2011 10:10:55 -0600	[thread overview]
Message-ID: <4EC6838F.8020705@calxeda.com> (raw)
In-Reply-To: <1321628948.21392.37.camel@zalecze.wat.corp.google.com>

On 11/18/2011 09:09 AM, Wojciech Baranowski wrote:
> While looking up linux name for platform device, check the address only if it
> has been supplied in lookup table.
> 
And the reason you want to do this is?

Rob

> Signed-off-by: Wojciech Baranowski <baranowski@chromium.org>
> ---
>  drivers/of/platform.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index cbd5d70..94763c0 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -314,12 +314,14 @@ static const struct of_dev_auxdata *of_dev_lookup(const struct of_dev_auxdata *l
>  	if (!lookup)
>  		return NULL;
>  
> -	for(; lookup->name != NULL; lookup++) {
> +	for (; lookup->name != NULL; lookup++) {
>  		if (!of_device_is_compatible(np, lookup->compatible))
>  			continue;
> -		if (of_address_to_resource(np, 0, &res))
> +		if (lookup->phys_addr &&
> +				of_address_to_resource(np, 0, &res))
>  			continue;
> -		if (res.start != lookup->phys_addr)
> +		if (lookup->phys_addr &&
> +				res.start != lookup->phys_addr)
>  			continue;
>  		pr_debug("%s: devname=%s\n", np->full_name, lookup->name);
>  		return lookup;

  reply	other threads:[~2011-11-18 16:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-18 15:09 [PATCH] of/platform: Allow missing address for dev name lookup Wojciech Baranowski
2011-11-18 16:10 ` Rob Herring [this message]
2011-11-18 16:45   ` Wojciech Baranowski
2011-11-18 22:12     ` Rob Herring

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=4EC6838F.8020705@calxeda.com \
    --to=rob.herring@calxeda.com \
    --cc=baranowski@chromium.org \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-kernel@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.