summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/of/base.c8
-rw-r--r--include/of.h3
2 files changed, 4 insertions, 7 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index 9d631276f1..0244281e28 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -1594,6 +1594,7 @@ void of_free(struct device_node *node)
{
struct device_node *n, *nt;
struct property *p, *pt;
+ struct device_d *dev;
if (!node)
return;
@@ -1610,10 +1611,9 @@ void of_free(struct device_node *node)
list_del(&node->list);
}
- if (node->device)
- node->device->device_node = NULL;
- else
- free(node->resource);
+ dev = of_find_device_by_node(node);
+ if (dev)
+ dev->device_node = NULL;
free(node->name);
free(node->full_name);
diff --git a/include/of.h b/include/of.h
index f33ed20bbd..f01d8544d4 100644
--- a/include/of.h
+++ b/include/of.h
@@ -30,9 +30,6 @@ struct device_node {
struct list_head children;
struct list_head parent_list;
struct list_head list;
- struct resource *resource;
- int num_resource;
- struct device_d *device;
struct list_head phandles;
phandle phandle;
};