lkml.org 
[lkml]   [2012]   [Feb]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 2/2] of: Make of_find_node_by_path() traverse /aliases for relative paths.
On 02/29/2012 12:36 PM, David Miller wrote:
> From: David Daney<ddaney.cavm@gmail.com>
> Date: Wed, 29 Feb 2012 11:21:04 -0800
>
>> Currently all paths passed to of_find_node_by_path() must begin with a
>> '/', indicating a full path to the desired node.
>>
>> Augment the look-up code so that if a path does *not* begin with '/',
>> the path is used as the name of an /aliases property. The value of
>> this alias is then used as the full node path to be found.
>>
>> Signed-off-by: David Daney<david.daney@cavium.com>
>
> But as the caller you sure as hell know whether you have a "/"
> prefixed name or not.

Yes, worst case we could just examine the first character of the string.

>
> Why complicate an incredibly well designed and simple function for
> something you can create another interface for?
>

Because in this message:

http://www.linux-mips.org/archives/linux-mips/2011-02/msg00147.html

Grant explicitly asked me to do it this way when he said:

of_find_node_by_path() needs to be fixed to also accept alias
values so that a string that starts with a '/' is a full path, but
no leading '/' means start with an alias. This code will lose a
level of indentation if you can make that change to the common
code.

And then in follow ups to that conversation, we eventually came up
with this patch.

If you find it particularly objectionable, convince Grant to NACK the
patch (but please keep me CCed on the conversation), and I will open
code the equivalent in my drivers.

Thanks,
David Daney


\
 
 \ /
  Last update: 2012-02-29 22:37    [W:0.135 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site