diff options
author | Simon Glass <sjg@chromium.org> | 2025-01-10 17:00:29 -0700 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-01-22 17:08:24 -0600 |
commit | 8985ff56b16dc6c04da2c96d48e7f6f54d04e3ff (patch) | |
tree | cccf61de5faa6550782765a05b1bd05b52919e09 /include/dm/ofnode.h | |
parent | aacc05b07d28e01bbbaf9037b3e8e1275e48701f (diff) |
dm: core: Provide ofnode_find_subnode_unit()
The ofnode_find_subnode() function currently processes things two
different ways, so the treatment of unit addresses differs depending on
whether OF_LIVE is enabled or not.
Add a new version which uses the ofnode API and add a test to check that
unit addresses can be matched correctly. Leave the old function in place
for the !OF_LIVE case, to avoid a code-size increase, e.g. on
firefly-rk3288
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/dm/ofnode.h')
-rw-r--r-- | include/dm/ofnode.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/dm/ofnode.h b/include/dm/ofnode.h index 8e4c3574df8..120393426db 100644 --- a/include/dm/ofnode.h +++ b/include/dm/ofnode.h @@ -607,6 +607,18 @@ bool ofnode_read_bool(ofnode node, const char *propname); */ ofnode ofnode_find_subnode(ofnode node, const char *subnode_name); +/** + * ofnode_find_subnode_unit() - find a named subnode of a parent node + * + * @node: valid reference to parent node + * @subnode_name: name of subnode to find, including any unit address. If the + * unit address is omitted, any subnode which matches the name (excluding + * any unit address) is returned + * Return: reference to subnode (which can be invalid if there is no such + * subnode) + */ +ofnode ofnode_find_subnode_unit(ofnode node, const char *subnode_name); + #if CONFIG_IS_ENABLED(DM_INLINE_OFNODE) #include <asm/global_data.h> |