Skip to content
Snippets Groups Projects
Commit a9e8e291 authored by Simon Glass's avatar Simon Glass
Browse files

fdt: Export the fdt_find_or_add_subnode() function


This function is useful for ensuring that a node exists. Export it so it
can be used more widely.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Acked-by: default avatarAnatolij Gustschin <agust@denx.de>
Reviewed-by: default avatarTom Rini <trini@ti.com>
parent 4ba98dc2
No related branches found
No related tags found
No related merge requests found
...@@ -113,7 +113,8 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop, ...@@ -113,7 +113,8 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
} }
/** /**
* fdt_find_or_add_subnode - find or possibly add a subnode of a given node * fdt_find_or_add_subnode() - find or possibly add a subnode of a given node
*
* @fdt: pointer to the device tree blob * @fdt: pointer to the device tree blob
* @parentoffset: structure block offset of a node * @parentoffset: structure block offset of a node
* @name: name of the subnode to locate * @name: name of the subnode to locate
...@@ -121,8 +122,7 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop, ...@@ -121,8 +122,7 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop,
* fdt_subnode_offset() finds a subnode of the node with a given name. * fdt_subnode_offset() finds a subnode of the node with a given name.
* If the subnode does not exist, it will be created. * If the subnode does not exist, it will be created.
*/ */
static int fdt_find_or_add_subnode(void *fdt, int parentoffset, int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name)
const char *name)
{ {
int offset; int offset;
......
...@@ -64,6 +64,8 @@ static inline void fdt_fixup_crypto_node(void *blob, int sec_rev) {} ...@@ -64,6 +64,8 @@ static inline void fdt_fixup_crypto_node(void *blob, int sec_rev) {}
int fdt_pci_dma_ranges(void *blob, int phb_off, struct pci_controller *hose); int fdt_pci_dma_ranges(void *blob, int phb_off, struct pci_controller *hose);
#endif #endif
int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name);
/** /**
* Add board-specific data to the FDT before booting the OS. * Add board-specific data to the FDT before booting the OS.
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment