Skip to content
Snippets Groups Projects
Commit 49b97d9c authored by Kumar Gala's avatar Kumar Gala
Browse files

fdt: Add fdt_del_node_and_alias helper


Add a helper function that given an alias will delete both the node
the alias points to and the alias itself

Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
Acked-by: default avatarGerald Van Baren <vanbaren@cideas.com>
parent 69bcf5bc
No related branches found
No related tags found
No related merge requests found
...@@ -976,3 +976,16 @@ void fdt_fixup_mtdparts(void *blob, void *node_info, int node_info_size) ...@@ -976,3 +976,16 @@ void fdt_fixup_mtdparts(void *blob, void *node_info, int node_info_size)
} }
} }
#endif #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);
}
...@@ -82,6 +82,7 @@ int fdt_resize(void *blob); ...@@ -82,6 +82,7 @@ int fdt_resize(void *blob);
int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size); 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_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 /* ifdef CONFIG_OF_LIBFDT */
#endif /* ifndef __FDT_SUPPORT_H */ #endif /* ifndef __FDT_SUPPORT_H */
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