[POWERPC] Rename get_property to of_get_property
authorStephen Rothwell <sfr@canb.auug.org.au>
Tue, 3 Apr 2007 00:54:01 +0000 (10:54 +1000)
committerPaul Mackerras <paulus@samba.org>
Thu, 12 Apr 2007 17:55:17 +0000 (03:55 +1000)
This is more consistent and gets us closer to the Sparc code.

We add a get_property define for compatibility during the change over.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/kernel/prom.c
include/asm-powerpc/prom.h
include/asm-ppc/prom.h

index ef6bfb70b24add4f87b7eb654c4753c7fbb012d9..6224728187236a0479d43c52f9061995df346747 100644 (file)
@@ -400,8 +400,8 @@ static unsigned long __init unflatten_dt_node(unsigned long mem,
        }
        if (allnextpp) {
                *prev_pp = NULL;
-               np->name = get_property(np, "name", NULL);
-               np->type = get_property(np, "device_type", NULL);
+               np->name = of_get_property(np, "name", NULL);
+               np->type = of_get_property(np, "device_type", NULL);
 
                if (!np->name)
                        np->name = "<NULL>";
@@ -1048,7 +1048,7 @@ prom_n_addr_cells(struct device_node* np)
        do {
                if (np->parent)
                        np = np->parent;
-               ip = get_property(np, "#address-cells", NULL);
+               ip = of_get_property(np, "#address-cells", NULL);
                if (ip != NULL)
                        return *ip;
        } while (np->parent);
@@ -1064,7 +1064,7 @@ prom_n_size_cells(struct device_node* np)
        do {
                if (np->parent)
                        np = np->parent;
-               ip = get_property(np, "#size-cells", NULL);
+               ip = of_get_property(np, "#size-cells", NULL);
                if (ip != NULL)
                        return *ip;
        } while (np->parent);
@@ -1136,7 +1136,7 @@ int device_is_compatible(const struct device_node *device, const char *compat)
        const char* cp;
        int cplen, l;
 
-       cp = get_property(device, "compatible", &cplen);
+       cp = of_get_property(device, "compatible", &cplen);
        if (cp == NULL)
                return 0;
        while (cplen > 0) {
@@ -1547,8 +1547,8 @@ static int of_finish_dynamic_node(struct device_node *node)
        int err = 0;
        const phandle *ibm_phandle;
 
-       node->name = get_property(node, "name", NULL);
-       node->type = get_property(node, "device_type", NULL);
+       node->name = of_get_property(node, "name", NULL);
+       node->type = of_get_property(node, "device_type", NULL);
 
        if (!parent) {
                err = -ENODEV;
@@ -1562,7 +1562,7 @@ static int of_finish_dynamic_node(struct device_node *node)
                return -ENODEV;
 
        /* fix up new node's linux_phandle field */
-       if ((ibm_phandle = get_property(node, "ibm,phandle", NULL)))
+       if ((ibm_phandle = of_get_property(node, "ibm,phandle", NULL)))
                node->linux_phandle = *ibm_phandle;
 
 out:
@@ -1625,13 +1625,13 @@ EXPORT_SYMBOL(of_find_property);
  * Find a property with a given name for a given node
  * and return the value.
  */
-const void *get_property(const struct device_node *np, const char *name,
+const void *of_get_property(const struct device_node *np, const char *name,
                         int *lenp)
 {
        struct property *pp = of_find_property(np,name,lenp);
        return pp ? pp->value : NULL;
 }
-EXPORT_SYMBOL(get_property);
+EXPORT_SYMBOL(of_get_property);
 
 /*
  * Add a property to a node
@@ -1762,10 +1762,10 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread)
                /* Check for ibm,ppc-interrupt-server#s. If it doesn't exist
                 * fallback to "reg" property and assume no threads
                 */
-               intserv = get_property(np, "ibm,ppc-interrupt-server#s",
+               intserv = of_get_property(np, "ibm,ppc-interrupt-server#s",
                                &plen);
                if (intserv == NULL) {
-                       const u32 *reg = get_property(np, "reg", NULL);
+                       const u32 *reg = of_get_property(np, "reg", NULL);
                        if (reg == NULL)
                                continue;
                        if (*reg == hardid) {
index 994de8ea33086dee690b96536b84c6c59a9f193a..448c5ce76fbeb9de640e5fd89acffdf8fe67f9e6 100644 (file)
@@ -165,9 +165,10 @@ extern void early_init_devtree(void *);
 extern int device_is_compatible(const struct device_node *device,
                                const char *);
 extern int machine_is_compatible(const char *compat);
-extern const void *get_property(const struct device_node *node,
+extern const void *of_get_property(const struct device_node *node,
                                const char *name,
                                int *lenp);
+#define get_property(a, b, c)  of_get_property((a), (b), (c))
 extern void print_properties(struct device_node *node);
 extern int prom_n_addr_cells(struct device_node* np);
 extern int prom_n_size_cells(struct device_node* np);
index adc5ae78492411fd836e31fb48082b63aa795471..901f7fa8b2d7dbda789913eecd180a6d0cadc588 100644 (file)
@@ -34,7 +34,8 @@ extern unsigned long sub_reloc_offset(unsigned long);
  */
 #define machine_is_compatible(x)               0
 #define of_find_compatible_node(f, t, c)       NULL
-#define get_property(p, n, l)                  NULL
+#define of_get_property(p, n, l)               NULL
+#define get_property(a, b, c)                  of_get_property((a), (b), (c))
 
 #endif /* _PPC_PROM_H */
 #endif /* __KERNEL__ */