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>
This commit is contained in:
parent
e118761c5f
commit
517fcac5f0
|
@ -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:
|
||||
|
|
|
@ -107,6 +107,9 @@ int of_probe(void);
|
|||
int of_parse_dtb(struct fdt_header *fdt);
|
||||
void of_free(struct device_node *node);
|
||||
int of_unflatten_dtb(struct fdt_header *fdt);
|
||||
struct property *of_new_property(struct device_node *node, const char *name,
|
||||
const void *data, int len);
|
||||
void of_delete_property(struct property *pp);
|
||||
|
||||
int of_property_read_string(struct device_node *np, const char *propname,
|
||||
const char **out_string);
|
||||
|
|
Loading…
Reference in New Issue