Patchwork [11/28] device tree: add nop_node

login
register
mail settings
Submitter Alexander Graf
Date July 23, 2011, 10:49 a.m.
Message ID <1311418212-13356-12-git-send-email-agraf@suse.de>
Download mbox | patch
Permalink /patch/106439/
State New
Headers show

Comments

Alexander Graf - July 23, 2011, 10:49 a.m.
We have a qemu internal abstraction layer on FDT. While I'm not fully convinced
we need it at all, it's missing the nop_node functionality that we now need
on e500. So let's add it and think about the general future of that API later.

Signed-off-by: Alexander Graf <agraf@suse.de>
---
 device_tree.c |   11 +++++++++++
 device_tree.h |    1 +
 2 files changed, 12 insertions(+), 0 deletions(-)

Patch

diff --git a/device_tree.c b/device_tree.c
index f5d5eb1..ec79dba 100644
--- a/device_tree.c
+++ b/device_tree.c
@@ -107,3 +107,14 @@  int qemu_devtree_setprop_string(void *fdt, const char *node_path,
 
     return fdt_setprop_string(fdt, offset, property, string);
 }
+
+int qemu_devtree_nop_node(void *fdt, const char *node_path)
+{
+    int offset;
+
+    offset = fdt_path_offset(fdt, node_path);
+    if (offset < 0)
+        return offset;
+
+    return fdt_nop_node(fdt, offset);
+}
diff --git a/device_tree.h b/device_tree.h
index cecd98f..76fce5f 100644
--- a/device_tree.h
+++ b/device_tree.h
@@ -22,5 +22,6 @@  int qemu_devtree_setprop_cell(void *fdt, const char *node_path,
                               const char *property, uint32_t val);
 int qemu_devtree_setprop_string(void *fdt, const char *node_path,
                                 const char *property, const char *string);
+int qemu_devtree_nop_node(void *fdt, const char *node_path);
 
 #endif /* __DEVICE_TREE_H__ */