aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorGrant Likely <grant.likely@secretlab.ca>2010-01-28 16:06:53 -0500
committerGrant Likely <grant.likely@secretlab.ca>2010-01-28 16:06:53 -0500
commit6016a363f6b56b46b24655bcfc0499b715851cf3 (patch)
treeaaca35be4765ec7c7d847bed702c121bbd1b8a81 /arch/sparc
parent923f7e30b480438f1e86e01e5cde814248b59a39 (diff)
of: unify phandle name in struct device_node
In struct device_node, the phandle is named 'linux_phandle' for PowerPC and MicroBlaze, and 'node' for SPARC. There is no good reason for the difference, it is just an artifact of the code diverging over a couple of years. This patch renames both to simply .phandle. Note: the .node also existed in PowerPC/MicroBlaze, but the only user seems to be arch/powerpc/platforms/powermac/pfunc_core.c. It doesn't look like the assignment between .linux_phandle and .node is significantly different enough to warrant the separate code paths unless ibm,phandle properties actually appear in Apple device trees. I think it is safe to eliminate the old .node property and use phandle everywhere. Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Acked-by: David S. Miller <davem@davemloft.net> Tested-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/kernel/devices.c2
-rw-r--r--arch/sparc/kernel/of_device_32.c2
-rw-r--r--arch/sparc/kernel/of_device_64.c2
-rw-r--r--arch/sparc/kernel/prom_common.c8
-rw-r--r--arch/sparc/kernel/smp_64.c2
5 files changed, 8 insertions, 8 deletions
diff --git a/arch/sparc/kernel/devices.c b/arch/sparc/kernel/devices.c
index b171ae8de90d..b062de9424a4 100644
--- a/arch/sparc/kernel/devices.c
+++ b/arch/sparc/kernel/devices.c
@@ -59,7 +59,7 @@ static int __cpu_find_by(int (*compare)(int, int, void *), void *compare_arg,
59 59
60 cur_inst = 0; 60 cur_inst = 0;
61 for_each_node_by_type(dp, "cpu") { 61 for_each_node_by_type(dp, "cpu") {
62 int err = check_cpu_node(dp->node, &cur_inst, 62 int err = check_cpu_node(dp->phandle, &cur_inst,
63 compare, compare_arg, 63 compare, compare_arg,
64 prom_node, mid); 64 prom_node, mid);
65 if (!err) { 65 if (!err) {
diff --git a/arch/sparc/kernel/of_device_32.c b/arch/sparc/kernel/of_device_32.c
index 4c26eb59e742..09138d403c7f 100644
--- a/arch/sparc/kernel/of_device_32.c
+++ b/arch/sparc/kernel/of_device_32.c
@@ -433,7 +433,7 @@ build_resources:
433 if (!parent) 433 if (!parent)
434 dev_set_name(&op->dev, "root"); 434 dev_set_name(&op->dev, "root");
435 else 435 else
436 dev_set_name(&op->dev, "%08x", dp->node); 436 dev_set_name(&op->dev, "%08x", dp->phandle);
437 437
438 if (of_device_register(op)) { 438 if (of_device_register(op)) {
439 printk("%s: Could not register of device.\n", 439 printk("%s: Could not register of device.\n",
diff --git a/arch/sparc/kernel/of_device_64.c b/arch/sparc/kernel/of_device_64.c
index 881947e59e95..036f18ae59a6 100644
--- a/arch/sparc/kernel/of_device_64.c
+++ b/arch/sparc/kernel/of_device_64.c
@@ -666,7 +666,7 @@ static struct of_device * __init scan_one_device(struct device_node *dp,
666 if (!parent) 666 if (!parent)
667 dev_set_name(&op->dev, "root"); 667 dev_set_name(&op->dev, "root");
668 else 668 else
669 dev_set_name(&op->dev, "%08x", dp->node); 669 dev_set_name(&op->dev, "%08x", dp->phandle);
670 670
671 if (of_device_register(op)) { 671 if (of_device_register(op)) {
672 printk("%s: Could not register of device.\n", 672 printk("%s: Could not register of device.\n",
diff --git a/arch/sparc/kernel/prom_common.c b/arch/sparc/kernel/prom_common.c
index d80a65d9e893..5832e13dfeeb 100644
--- a/arch/sparc/kernel/prom_common.c
+++ b/arch/sparc/kernel/prom_common.c
@@ -42,7 +42,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)
42 struct device_node *np; 42 struct device_node *np;
43 43
44 for (np = allnodes; np; np = np->allnext) 44 for (np = allnodes; np; np = np->allnext)
45 if (np->node == handle) 45 if (np->phandle == handle)
46 break; 46 break;
47 47
48 return np; 48 return np;
@@ -89,7 +89,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
89 void *old_val = prop->value; 89 void *old_val = prop->value;
90 int ret; 90 int ret;
91 91
92 ret = prom_setprop(dp->node, name, val, len); 92 ret = prom_setprop(dp->phandle, name, val, len);
93 93
94 err = -EINVAL; 94 err = -EINVAL;
95 if (ret >= 0) { 95 if (ret >= 0) {
@@ -236,7 +236,7 @@ static struct device_node * __init prom_create_node(phandle node,
236 236
237 dp->name = get_one_property(node, "name"); 237 dp->name = get_one_property(node, "name");
238 dp->type = get_one_property(node, "device_type"); 238 dp->type = get_one_property(node, "device_type");
239 dp->node = node; 239 dp->phandle = node;
240 240
241 dp->properties = build_prop_list(node); 241 dp->properties = build_prop_list(node);
242 242
@@ -313,7 +313,7 @@ void __init prom_build_devicetree(void)
313 313
314 nextp = &allnodes->allnext; 314 nextp = &allnodes->allnext;
315 allnodes->child = prom_build_tree(allnodes, 315 allnodes->child = prom_build_tree(allnodes,
316 prom_getchild(allnodes->node), 316 prom_getchild(allnodes->phandle),
317 &nextp); 317 &nextp);
318 of_console_init(); 318 of_console_init();
319 319
diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index aa36223497b9..eb14844a0021 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -370,7 +370,7 @@ static int __cpuinit smp_boot_one_cpu(unsigned int cpu)
370 } else { 370 } else {
371 struct device_node *dp = of_find_node_by_cpuid(cpu); 371 struct device_node *dp = of_find_node_by_cpuid(cpu);
372 372
373 prom_startcpu(dp->node, entry, cookie); 373 prom_startcpu(dp->phandle, entry, cookie);
374 } 374 }
375 375
376 for (timeout = 0; timeout < 50000; timeout++) { 376 for (timeout = 0; timeout < 50000; timeout++) {