public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/5] fdt: add fdt_del_node_by_path() API
@ 2009-12-10  7:41 Li Yang
  2009-12-10  7:41 ` [U-Boot] [PATCH 2/5] fsl_law: add SRIO2 target id and law_size_bits() macro Li Yang
  2009-12-10 14:51 ` [U-Boot] [PATCH 1/5] fdt: add fdt_del_node_by_path() API Kumar Gala
  0 siblings, 2 replies; 8+ messages in thread
From: Li Yang @ 2009-12-10  7:41 UTC (permalink / raw)
  To: u-boot

For removing node easily by path or alias.

Signed-off-by: Li Yang <leoli@freescale.com>
---
 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 */
-- 
1.6.4

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-12-10 16:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-10  7:41 [U-Boot] [PATCH 1/5] fdt: add fdt_del_node_by_path() API Li Yang
2009-12-10  7:41 ` [U-Boot] [PATCH 2/5] fsl_law: add SRIO2 target id and law_size_bits() macro Li Yang
2009-12-10  7:41   ` [U-Boot] [PATCH 3/5] 85xx: add common serdes ports configuration code Li Yang
2009-12-10  7:41     ` [U-Boot] [PATCH 4/5] p2020: add serdes status code complying to fsl_serdes APIs Li Yang
2009-12-10  7:41       ` [U-Boot] [PATCH 5/5] p2020ds: use common code to initialize serdes ports Li Yang
2009-12-10 15:07   ` [U-Boot] [PATCH 2/5] fsl_law: add SRIO2 target id and law_size_bits() macro Kumar Gala
2009-12-10 14:51 ` [U-Boot] [PATCH 1/5] fdt: add fdt_del_node_by_path() API Kumar Gala
2009-12-10 16:15   ` Jerry Van Baren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox