lkml.org 
[lkml]   [2011]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] of/platform: Allow missing address for dev name lookup
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;



\
 
 \ /
  Last update: 2011-11-18 17:13    [W:0.044 / U:0.248 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site