Re: [PATCH v2 11/11] of: unify phandle name in struct device_node

2009-11-24 Thread Grant Likely
On Tue, Nov 24, 2009 at 6:30 PM, Segher Boessenkool
 wrote:
>> 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
>> linux_phandle everywhere.
>
>    You forgot to update one :-)

Heeheehee.  oops.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v2 11/11] of: unify phandle name in struct device_node

2009-11-24 Thread Segher Boessenkool
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
linux_phandle everywhere.


    You forgot to update one :-)





Segher

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH v2 11/11] of: unify phandle name in struct device_node

2009-11-24 Thread David Miller
From: Grant Likely 
Date: Tue, 24 Nov 2009 15:01:14 -0700

> 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
> linux_phandle everywhere.
> 
> Signed-off-by: Grant Likely 

Acked-by: David S. Miller 
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 11/11] of: unify phandle name in struct device_node

2009-11-24 Thread Grant Likely
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
linux_phandle everywhere.

Signed-off-by: Grant Likely 
---

 arch/microblaze/kernel/of_platform.c |2 +-
 arch/microblaze/kernel/prom.c|2 +-
 arch/powerpc/kernel/of_platform.c|2 +-
 arch/powerpc/kernel/prom.c   |6 +++---
 arch/powerpc/platforms/cell/spu_manage.c |6 +++---
 arch/powerpc/platforms/powermac/pfunc_core.c |2 +-
 arch/sparc/kernel/devices.c  |2 +-
 arch/sparc/kernel/of_device_32.c |2 +-
 arch/sparc/kernel/of_device_64.c |2 +-
 arch/sparc/kernel/prom_common.c  |8 
 arch/sparc/kernel/smp_64.c   |2 +-
 drivers/of/fdt.c |7 +++
 drivers/sbus/char/openprom.c |   10 +-
 drivers/video/aty/atyfb_base.c   |2 +-
 include/linux/of.h   |5 +
 sound/aoa/fabrics/layout.c   |2 +-
 16 files changed, 29 insertions(+), 33 deletions(-)

diff --git a/arch/microblaze/kernel/of_platform.c 
b/arch/microblaze/kernel/of_platform.c
index acf4574..1c6d684 100644
--- a/arch/microblaze/kernel/of_platform.c
+++ b/arch/microblaze/kernel/of_platform.c
@@ -185,7 +185,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
 static int of_dev_phandle_match(struct device *dev, void *data)
 {
phandle *ph = data;
-   return to_of_device(dev)->node->linux_phandle == *ph;
+   return to_of_device(dev)->node->phandle == *ph;
 }
 
 struct of_device *of_find_device_by_phandle(phandle ph)
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index 1f79e4d..9b4a20b 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -251,7 +251,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)
 
read_lock(&devtree_lock);
for (np = allnodes; np != NULL; np = np->allnext)
-   if (np->linux_phandle == handle)
+   if (np->phandle == handle)
break;
of_node_get(np);
read_unlock(&devtree_lock);
diff --git a/arch/powerpc/kernel/of_platform.c 
b/arch/powerpc/kernel/of_platform.c
index 1a4fc0d..666d08d 100644
--- a/arch/powerpc/kernel/of_platform.c
+++ b/arch/powerpc/kernel/of_platform.c
@@ -214,7 +214,7 @@ EXPORT_SYMBOL(of_find_device_by_node);
 static int of_dev_phandle_match(struct device *dev, void *data)
 {
phandle *ph = data;
-   return to_of_device(dev)->node->linux_phandle == *ph;
+   return to_of_device(dev)->node->phandle == *ph;
 }
 
 struct of_device *of_find_device_by_phandle(phandle ph)
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index 7d0beeb..d3ce311 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -701,7 +701,7 @@ struct device_node *of_find_node_by_phandle(phandle handle)
 
read_lock(&devtree_lock);
for (np = allnodes; np != 0; np = np->allnext)
-   if (np->linux_phandle == handle)
+   if (np->phandle == handle)
break;
of_node_get(np);
read_unlock(&devtree_lock);
@@ -771,9 +771,9 @@ static int of_finish_dynamic_node(struct device_node *node)
if (machine_is(powermac))
return -ENODEV;
 
-   /* fix up new node's linux_phandle field */
+   /* fix up new node's phandle field */
if ((ibm_phandle = of_get_property(node, "ibm,phandle", NULL)))
-   node->linux_phandle = *ibm_phandle;
+   node->phandle = *ibm_phandle;
 
 out:
of_node_put(parent);
diff --git a/arch/powerpc/platforms/cell/spu_manage.c 
b/arch/powerpc/platforms/cell/spu_manage.c
index 4c506c1..891f18e 100644
--- a/arch/powerpc/platforms/cell/spu_manage.c
+++ b/arch/powerpc/platforms/cell/spu_manage.c
@@ -457,7 +457,7 @@ neighbour_spu(int cbe, struct device_node *target, struct 
device_node *avoid)
continue;
vic_handles = of_get_property(spu_dn, "vicinity", &lenp);
for (i=0; i < (lenp / sizeof(phandle)); i++) {
-   if (vic_handles[i] == target->linux_phandle)
+   if (vic_handles[i] == target->phandle)
return spu;
}
}
@@ -499,7 +499