From: Simon Glass Date: Wed, 15 Oct 2014 02:05:33 -0600 Subject: [U-Boot] [PATCH 03/11] fdt: Export the fdt_find_or_add_subnode() function In-Reply-To: <1413360341-25828-1-git-send-email-sjg@chromium.org> References: <1413360341-25828-1-git-send-email-sjg@chromium.org> Message-ID: <1413360341-25828-3-git-send-email-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de This function is useful for ensuring that a node exists. Export it so it can be used more widely. Signed-off-by: Simon Glass --- common/fdt_support.c | 12 +----------- include/fdt_support.h | 12 ++++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/common/fdt_support.c b/common/fdt_support.c index 3f64156..dc41222 100644 --- a/common/fdt_support.c +++ b/common/fdt_support.c @@ -112,17 +112,7 @@ int fdt_find_and_setprop(void *fdt, const char *node, const char *prop, return fdt_setprop(fdt, nodeoff, prop, val, len); } -/** - * fdt_find_or_add_subnode - find or possibly add a subnode of a given node - * @fdt: pointer to the device tree blob - * @parentoffset: structure block offset of a node - * @name: name of the subnode to locate - * - * fdt_subnode_offset() finds a subnode of the node with a given name. - * If the subnode does not exist, it will be created. - */ -static int fdt_find_or_add_subnode(void *fdt, int parentoffset, - const char *name) +int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name) { int offset; diff --git a/include/fdt_support.h b/include/fdt_support.h index 41ce535..c0278d6 100644 --- a/include/fdt_support.h +++ b/include/fdt_support.h @@ -65,6 +65,18 @@ int fdt_pci_dma_ranges(void *blob, int phb_off, struct pci_controller *hose); #endif /** + * fdt_find_or_add_subnode() - find or possibly add a subnode of a given node + * + * @fdt: pointer to the device tree blob + * @parentoffset: structure block offset of a node + * @name: name of the subnode to locate + * + * fdt_subnode_offset() finds a subnode of the node with a given name. + * If the subnode does not exist, it will be created. + */ +int fdt_find_or_add_subnode(void *fdt, int parentoffset, const char *name); + +/** * Add board-specific data to the FDT before booting the OS. * * Use CONFIG_SYS_FDT_PAD to ensure there is sufficient space. -- 2.1.0.rc2.206.gedb03e5