From: Jerry Van Baren <gvb.uboot@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] fdt_find_compatible_node() and friends
Date: Thu, 17 May 2007 06:38:32 -0400 [thread overview]
Message-ID: <464C30A8.3000002@gmail.com> (raw)
In-Reply-To: <463C80BB.5080305@grandegger.com>
Wolfgang Grandegger wrote:
> Hi Jerry,
>
> Jerry Van Baren wrote:
>> Wolfgang Grandegger wrote:
>>> Hi Jerry,
>>>
>>> before re-coding fdt_find_compatible_node(), some more comments.
>>>
>>> After browsing more carefully the FDT related code of "arch/powerpc"
>>> I think we also need, apart from fdt_find_compatible_node() and
>>> fdt_path_offset(), fdt_find_node_by_type() and maybe
>>> fdt_find_node_by_name(). These functions do a sequential scan of all
>>> devices starting at the beginning or after a specified node. They
>>> actually ignore the hierarchy. Do you agree?
>>> BTW: any reason why not using the more compatible name
>>> fdt_find_node_by_path() for fdt_path_offset()?
>>>
>>> Wolfgang.
>>
>> Hi WolfganG,
>>
>> I'm not an expert, I just fake it on email ;-). With that disclaimer,
>> I would agree with you WRT all the "find" functions. The original
>> libfdt code does not support any "find" functions, so we will need to
>> add them.
>>
>> WRT to fdt_find_node_by_path() vs. fdt_path_offset(), I vaguely recall
>> some renames happening in the kernel source, but I cannot find them so
>> my memory likely is faulty[1]. I would be strongly in favor of
>> following the kernel's lead and renaming that function since we are
>> already divergent from the original libfdt. The kernel's name is a
>> much better description.
>
> OK, I have attached two new patches replacing fdt_path_offset() with
> fdt_find_node_by_path() and implementing fdt_find_node_by_type() and
> fdt_find_compatible_node(). This version does not use static variables
> any more to scan the nodes without re-scanning, but looks for the end
> tag. I think it's (almost) good enough to be applied.
>
> Wolfgang.
>
>
> ------------------------------------------------------------------------
>
> Replace fdt_node_offset() with fdt_find_node_by_path().
>
> From: Wolfgang Grandegger <wg@grandegger.com>
>
> The new name matches more closely the kernel's name, which is also
> a much better description.
> ---
>
> board/mpc8360emds/mpc8360emds.c | 2 +-
> board/mpc8360emds/pci.c | 2 +-
> common/cmd_fdt.c | 6 +++---
> common/fdt_support.c | 10 +++++-----
> cpu/mpc83xx/cpu.c | 2 +-
> include/libfdt.h | 2 +-
> libfdt/fdt_ro.c | 2 +-
> 7 files changed, 13 insertions(+), 13 deletions(-)
Hi Wolfgang G,
I've applied your patches to my local (working) repository and will push
the changes tonight (my tonight, your tomorrow ;-). I created a
subroutine out of three snippets of code in cmd_fdt.c which your
fdt_find_node_by_path() change fixed up so I had to fix one line in the
new subroutine by hand. Not bad at all considering the changes I made
in that file.
Your patches have a From: line rather than a Signed-off-by: line, I
presume it is OK (and desirable) for me to change it into a
Signed-off-by: line (I'll add my own Acked-by: line).
Thanks,
gvb
next prev parent reply other threads:[~2007-05-17 10:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-03 14:47 [U-Boot-Users] fdt_find_compatible_node() and friends Wolfgang Grandegger
2007-05-03 15:14 ` Jerry Van Baren
2007-05-05 13:03 ` Wolfgang Grandegger
2007-05-16 10:40 ` Wolfgang Grandegger
2007-05-16 13:33 ` Jerry Van Baren
2007-05-17 10:38 ` Jerry Van Baren [this message]
2007-05-17 11:32 ` Wolfgang Grandegger
2007-05-17 12:04 ` Jerry Van Baren
2007-05-17 12:31 ` Wolfgang Grandegger
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=464C30A8.3000002@gmail.com \
--to=gvb.uboot@gmail.com \
--cc=u-boot@lists.denx.de \
/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.