dm: core: Allow obtaining a node offset in the same tree
authorSimon Glass <sjg@chromium.org>
Wed, 7 Sep 2022 02:27:23 +0000 (20:27 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 30 Sep 2022 02:43:43 +0000 (22:43 -0400)
commit2187cb7e4aaae7a4ed7318a073b26dff462cb7a1
tree1f99048a80467776ab8c0d71f3a35f76f8318bda
parent928d267aeea9406497c8060c03d3a0a78a8cbaa9
dm: core: Allow obtaining a node offset in the same tree

In some cases we want to obtain an ofnode in the same tree as a different
ofnode, such as when looking up a subnode. At present this is trivial,
since there is only one tree. When there are multiple trees, this
implementation will change.

Also move the ofnode_to_offset() function up higher in the header file,
since we will need to provide a different implementation with multiple
trees.

Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/core/ofnode.c
include/dm/ofnode.h