[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAC0oEedK1E4K9mSS_pOKz_xvHtXy576kCe9oG+D3aHz14tW=WA@mail.gmail.com>
Date: Fri, 18 Nov 2011 11:45:00 -0500
From: Wojciech Baranowski <baranowski@...gle.com>
To: Rob Herring <rob.herring@...xeda.com>
Cc: devicetree-discuss@...ts.ozlabs.org,
Grant Likely <grant.likely@...retlab.ca>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] of/platform: Allow missing address for dev name lookup
On Fri, Nov 18, 2011 at 11:10 AM, Rob Herring <rob.herring@...xeda.com> wrote:
> 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?
Name lookup table is used to provide names for platform devices on the
board I'm working on. I'm adding /sound node without address for audio
subsystem and don't want to break that convention.
>> Signed-off-by: Wojciech Baranowski <baranowski@...omium.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;
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists