Skip to contentSkip to conversation

: sparc: Move create_node() and friends into

PATCH In review David Miller 1 participant 1 message Dec 6, 2008 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 10/14 : sparc: Move create_node() and friends into

sparc: Move create_node() and friends into prom_common.c

---
 arch/sparc/kernel/prom.h        |    3 +-
 arch/sparc/kernel/prom_32.c     |   38 ------------------------------------
 arch/sparc/kernel/prom_64.c     |   38 ------------------------------------
 arch/sparc/kernel/prom_common.c |   41 ++++++++++++++++++++++++++++++++++++++-
 4 files changed, 42 insertions(+), 78 deletions(-)
arch/sparc/kernel/prom.h +2 -1
index 49c25bd..d14b4ae 100644
@@ -15,6 +15,7 @@ extern void irq_trans_init(struct device_node *dp);
 
 extern unsigned int prom_unique_id;
 
-extern struct property * __init build_prop_list(phandle node);
+extern struct device_node * __init create_node(phandle node,
+					       struct device_node *parent);
 
 #endif /* __PROM_H */
arch/sparc/kernel/prom_32.c +0 -38
index 5818aa9..5881c14 100644
@@ -196,44 +196,6 @@ static char * __init build_full_name(struct device_node *dp)
 	return n;
 }
 
-static char * __init get_one_property(phandle node, const char *name)
-{
-	char *buf = "<NULL>";
-	int len;
-
-	len = prom_getproplen(node, name);
-	if (len > 0) {
-		buf = prom_early_alloc(len);
-		len = prom_getproperty(node, name, buf, len);
-	}
-
-	return buf;
-}
-
-static struct device_node * __init create_node(phandle node, struct device_node *parent)
-{
-	struct device_node *dp;
-
-	if (!node)
-		return NULL;
-
-	dp = prom_early_alloc(sizeof(*dp));
-	dp->unique_id = prom_unique_id++;
-	dp->parent = parent;
-
-	kref_init(&dp->kref);
-
-	dp->name = get_one_property(node, "name");
-	dp->type = get_one_property(node, "device_type");
-	dp->node = node;
-
-	/* Build interrupts later... */
-
-	dp->properties = build_prop_list(node);
-
-	return dp;
-}
-
 static struct device_node * __init build_tree(struct device_node *parent, phandle node, struct device_node ***nextp)
 {
 	struct device_node *dp;
arch/sparc/kernel/prom_64.c +0 -38
index ce96c1c..c1ce987 100644
@@ -399,44 +399,6 @@ static char * __init build_full_name(struct device_node *dp)
 	return n;
 }
 
-static char * __init get_one_property(phandle node, const char *name)
-{
-	char *buf = "<NULL>";
-	int len;
-
-	len = prom_getproplen(node, name);
-	if (len > 0) {
-		buf = prom_early_alloc(len);
-		len = prom_getproperty(node, name, buf, len);
-	}
-
-	return buf;
-}
-
-static struct device_node * __init create_node(phandle node, struct device_node *parent)
-{
-	struct device_node *dp;
-
-	if (!node)
-		return NULL;
-
-	dp = prom_early_alloc(sizeof(*dp));
-	dp->unique_id = prom_unique_id++;
-	dp->parent = parent;
-
-	kref_init(&dp->kref);
-
-	dp->name = get_one_property(node, "name");
-	dp->type = get_one_property(node, "device_type");
-	dp->node = node;
-
-	dp->properties = build_prop_list(node);
-
-	irq_trans_init(dp);
-
-	return dp;
-}
-
 static struct device_node * __init build_tree(struct device_node *parent, phandle node, struct device_node ***nextp)
 {
 	struct device_node *ret = NULL, *prev_sibling = NULL;
arch/sparc/kernel/prom_common.c +40 -1

50 lines not on this page · raw message

Signature · 1 line
1.5.6.5