From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerry Van Baren Date: Wed, 09 Dec 2009 21:48:06 -0500 Subject: [U-Boot] [PATCH 2/3] fdt: add fdt_del_node_by_path() API In-Reply-To: <1260339968-28169-2-git-send-email-leoli@freescale.com> References: <1260339968-28169-1-git-send-email-leoli@freescale.com> <1260339968-28169-2-git-send-email-leoli@freescale.com> Message-ID: <4B206166.5040706@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Li, Li Yang wrote: > For removing node easily by path or alias. > > Signed-off-by: Li Yang > --- > common/fdt_support.c | 10 ++++++++++ > include/fdt_support.h | 1 + > 2 files changed, 11 insertions(+), 0 deletions(-) > > diff --git a/common/fdt_support.c b/common/fdt_support.c > index f89a3ee..8f1186e 100644 > --- a/common/fdt_support.c > +++ b/common/fdt_support.c > @@ -757,3 +757,13 @@ int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size) > return -1; > } > #endif > + > +int fdt_del_node_by_path(void *fdt, const char *path) > +{ > + int off = fdt_path_offset(fdt, path); > + > + if (off >= 0) > + return fdt_del_node(fdt, off); > + else > + return off; > +} > diff --git a/include/fdt_support.h b/include/fdt_support.h > index 0a9dd0d..d0705d1 100644 > --- a/include/fdt_support.h > +++ b/include/fdt_support.h > @@ -80,6 +80,7 @@ void set_working_fdt_addr(void *addr); > int fdt_resize(void *blob); > > int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size); > +int fdt_del_node_by_path(void *fdt, const char *path); > > #endif /* ifdef CONFIG_OF_LIBFDT */ > #endif /* ifndef __FDT_SUPPORT_H */ This seems like a reasonable function, but I don't see it used anywhere? Best regards, gvb