* [U-Boot] [PATCH v2] fdt: Add fdt_del_node_and_alias helper
@ 2010-03-30 15:47 Kumar Gala
2010-03-30 22:20 ` Gerald Van Baren
0 siblings, 1 reply; 3+ messages in thread
From: Kumar Gala @ 2010-03-30 15:47 UTC (permalink / raw)
To: u-boot
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>
---
* Make alias param const
common/fdt_support.c | 13 +++++++++++++
include/fdt_support.h | 2 ++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/common/fdt_support.c b/common/fdt_support.c
index f89a3ee..0d0f513 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -757,3 +757,16 @@ int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size)
return -1;
}
#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);
+}
diff --git a/include/fdt_support.h b/include/fdt_support.h
index 0a9dd0d..5388c29 100644
--- a/include/fdt_support.h
+++ b/include/fdt_support.h
@@ -81,5 +81,7 @@ int fdt_resize(void *blob);
int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size);
+void fdt_del_node_and_alias(void *blob, const char *alias);
+
#endif /* ifdef CONFIG_OF_LIBFDT */
#endif /* ifndef __FDT_SUPPORT_H */
--
1.6.0.6
^ permalink raw reply related [flat|nested] 3+ messages in thread* [U-Boot] [PATCH v2] fdt: Add fdt_del_node_and_alias helper
2010-03-30 15:47 [U-Boot] [PATCH v2] fdt: Add fdt_del_node_and_alias helper Kumar Gala
@ 2010-03-30 22:20 ` Gerald Van Baren
2010-03-31 2:31 ` Kumar Gala
0 siblings, 1 reply; 3+ messages in thread
From: Gerald Van Baren @ 2010-03-30 22:20 UTC (permalink / raw)
To: u-boot
Hi Kumar,
Kumar Gala wrote:
> 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>
I assume you will want to apply this with the 8xxx patch that uses it, so...
Acked-by: Gerald Van Baren <vanbaren@cideas.com>
> ---
> * Make alias param const
>
> common/fdt_support.c | 13 +++++++++++++
> include/fdt_support.h | 2 ++
> 2 files changed, 15 insertions(+), 0 deletions(-)
>
> diff --git a/common/fdt_support.c b/common/fdt_support.c
> index f89a3ee..0d0f513 100644
> --- a/common/fdt_support.c
> +++ b/common/fdt_support.c
> @@ -757,3 +757,16 @@ int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size)
> return -1;
> }
> #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);
> +}
> diff --git a/include/fdt_support.h b/include/fdt_support.h
> index 0a9dd0d..5388c29 100644
> --- a/include/fdt_support.h
> +++ b/include/fdt_support.h
> @@ -81,5 +81,7 @@ int fdt_resize(void *blob);
>
> int fdt_fixup_nor_flash_size(void *blob, int cs, u32 size);
>
> +void fdt_del_node_and_alias(void *blob, const char *alias);
> +
> #endif /* ifdef CONFIG_OF_LIBFDT */
> #endif /* ifndef __FDT_SUPPORT_H */
^ permalink raw reply [flat|nested] 3+ messages in thread* [U-Boot] [PATCH v2] fdt: Add fdt_del_node_and_alias helper
2010-03-30 22:20 ` Gerald Van Baren
@ 2010-03-31 2:31 ` Kumar Gala
0 siblings, 0 replies; 3+ messages in thread
From: Kumar Gala @ 2010-03-31 2:31 UTC (permalink / raw)
To: u-boot
On Mar 30, 2010, at 5:20 PM, Gerald Van Baren wrote:
> Hi Kumar,
>
> Kumar Gala wrote:
>> 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>
>
> I assume you will want to apply this with the 8xxx patch that uses it, so...
>
> Acked-by: Gerald Van Baren <vanbaren@cideas.com>
Yep, thanks.
- k
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-31 2:31 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-30 15:47 [U-Boot] [PATCH v2] fdt: Add fdt_del_node_and_alias helper Kumar Gala
2010-03-30 22:20 ` Gerald Van Baren
2010-03-31 2:31 ` Kumar Gala
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox