summaryrefslogtreecommitdiffstats
path: root/drivers/of
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2013-01-09 16:47:16 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2013-01-19 11:48:17 +0100
commit517fcac5f02c8e26a600f1cf14c26af8265f3b29 (patch)
treee0300878cd275b1da947eb017ab50c4a50aa4d71 /drivers/of
parente118761c5f7e8e41fa3503ae96885459869dcb84 (diff)
downloadbarebox-517fcac5f02c8e26a600f1cf14c26af8265f3b29.tar.gz
barebox-517fcac5f02c8e26a600f1cf14c26af8265f3b29.tar.xz
of: add of_delete_property
This adds a function to delete a property from the currently loaded devicetree. Also export new_property as of_new_property. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/base.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 50c7ec98f0..a6a12f07fb 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -600,7 +600,7 @@ static struct device_node *new_device_node(struct device_node *parent)
return node;
}
-static struct property *new_property(struct device_node *node, const char *name,
+struct property *of_new_property(struct device_node *node, const char *name,
const void *data, int len)
{
struct property *prop;
@@ -617,6 +617,15 @@ static struct property *new_property(struct device_node *node, const char *name,
return prop;
}
+void of_delete_property(struct property *pp)
+{
+ list_del(&pp->list);
+
+ free(pp->name);
+ free(pp->value);
+ free(pp);
+}
+
static struct device_d *add_of_device(struct device_node *node)
{
struct device_d *dev;
@@ -902,7 +911,7 @@ int of_unflatten_dtb(struct fdt_header *fdt)
p->value = xzalloc(len);
memcpy(p->value, nodep, len);
} else {
- new_property(node, pathp, nodep, len);
+ of_new_property(node, pathp, nodep, len);
}
break;
case FDT_NOP: