]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
fdt: Add fdt_del_node_and_alias helper
authorKumar Gala <galak@kernel.crashing.org>
Tue, 30 Mar 2010 15:19:26 +0000 (10:19 -0500)
committerKumar Gala <galak@kernel.crashing.org>
Wed, 7 Apr 2010 05:08:18 +0000 (00:08 -0500)
Add a helper function that given an alias will delete both the node
the alias points to and the alias itself

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
common/fdt_support.c
include/fdt_support.h

index b7d4fe506364c38c8fcf07f932db757b90a60170..b6f252a87b0c9de15ec7ac02eca1990565392b43 100644 (file)
@@ -976,3 +976,16 @@ void fdt_fixup_mtdparts(void *blob, void *node_info, int node_info_size)
        }
 }
 #endif
+
+void fdt_del_node_and_alias(void *blob, const char *alias)
+{
+       int off = fdt_path_offset(blob, alias);
+
+       if (off < 0)
+               return;
+
+       fdt_del_node(blob, off);
+
+       off = fdt_path_offset(blob, "/aliases");
+       fdt_delprop(blob, off, alias);
+}
index a3d5f8cbfee69d820eb9bb8fdc1e40660df3c644..9a453af34b548256e0b7064e5bf06abda12e225f 100644 (file)
@@ -82,6 +82,7 @@ int fdt_resize(void *blob);
 int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size);
 
 void fdt_fixup_mtdparts(void *fdt, void *node_info, int node_info_size);
+void fdt_del_node_and_alias(void *blob, const char *alias);
 
 #endif /* ifdef CONFIG_OF_LIBFDT */
 #endif /* ifndef __FDT_SUPPORT_H */