aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kernel/prom.c24
-rw-r--r--include/asm-powerpc/prom.h3
-rw-r--r--include/asm-ppc/prom.h3
3 files changed, 16 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/prom.c b/arch/powerpc/kernel/prom.c
index ef6bfb70b24a..622472818723 100644
--- a/arch/powerpc/kernel/prom.c
+++ b/arch/powerpc/kernel/prom.c
@@ -400,8 +400,8 @@ static unsigned long __init unflatten_dt_node(unsigned long mem,
400 } 400 }
401 if (allnextpp) { 401 if (allnextpp) {
402 *prev_pp = NULL; 402 *prev_pp = NULL;
403 np->name = get_property(np, "name", NULL); 403 np->name = of_get_property(np, "name", NULL);
404 np->type = get_property(np, "device_type", NULL); 404 np->type = of_get_property(np, "device_type", NULL);
405 405
406 if (!np->name) 406 if (!np->name)
407 np->name = "<NULL>"; 407 np->name = "<NULL>";
@@ -1048,7 +1048,7 @@ prom_n_addr_cells(struct device_node* np)
1048 do { 1048 do {
1049 if (np->parent) 1049 if (np->parent)
1050 np = np->parent; 1050 np = np->parent;
1051 ip = get_property(np, "#address-cells", NULL); 1051 ip = of_get_property(np, "#address-cells", NULL);
1052 if (ip != NULL) 1052 if (ip != NULL)
1053 return *ip; 1053 return *ip;
1054 } while (np->parent); 1054 } while (np->parent);
@@ -1064,7 +1064,7 @@ prom_n_size_cells(struct device_node* np)
1064 do { 1064 do {
1065 if (np->parent) 1065 if (np->parent)
1066 np = np->parent; 1066 np = np->parent;
1067 ip = get_property(np, "#size-cells", NULL); 1067 ip = of_get_property(np, "#size-cells", NULL);
1068 if (ip != NULL) 1068 if (ip != NULL)
1069 return *ip; 1069 return *ip;
1070 } while (np->parent); 1070 } while (np->parent);
@@ -1136,7 +1136,7 @@ int device_is_compatible(const struct device_node *device, const char *compat)
1136 const char* cp; 1136 const char* cp;
1137 int cplen, l; 1137 int cplen, l;
1138 1138
1139 cp = get_property(device, "compatible", &cplen); 1139 cp = of_get_property(device, "compatible", &cplen);
1140 if (cp == NULL) 1140 if (cp == NULL)
1141 return 0; 1141 return 0;
1142 while (cplen > 0) { 1142 while (cplen > 0) {
@@ -1547,8 +1547,8 @@ static int of_finish_dynamic_node(struct device_node *node)
1547 int err = 0; 1547 int err = 0;
1548 const phandle *ibm_phandle; 1548 const phandle *ibm_phandle;
1549 1549
1550 node->name = get_property(node, "name", NULL); 1550 node->name = of_get_property(node, "name", NULL);
1551 node->type = get_property(node, "device_type", NULL); 1551 node->type = of_get_property(node, "device_type", NULL);
1552 1552
1553 if (!parent) { 1553 if (!parent) {
1554 err = -ENODEV; 1554 err = -ENODEV;
@@ -1562,7 +1562,7 @@ static int of_finish_dynamic_node(struct device_node *node)
1562 return -ENODEV; 1562 return -ENODEV;
1563 1563
1564 /* fix up new node's linux_phandle field */ 1564 /* fix up new node's linux_phandle field */
1565 if ((ibm_phandle = get_property(node, "ibm,phandle", NULL))) 1565 if ((ibm_phandle = of_get_property(node, "ibm,phandle", NULL)))
1566 node->linux_phandle = *ibm_phandle; 1566 node->linux_phandle = *ibm_phandle;
1567 1567
1568out: 1568out:
@@ -1625,13 +1625,13 @@ EXPORT_SYMBOL(of_find_property);
1625 * Find a property with a given name for a given node 1625 * Find a property with a given name for a given node
1626 * and return the value. 1626 * and return the value.
1627 */ 1627 */
1628const void *get_property(const struct device_node *np, const char *name, 1628const void *of_get_property(const struct device_node *np, const char *name,
1629 int *lenp) 1629 int *lenp)
1630{ 1630{
1631 struct property *pp = of_find_property(np,name,lenp); 1631 struct property *pp = of_find_property(np,name,lenp);
1632 return pp ? pp->value : NULL; 1632 return pp ? pp->value : NULL;
1633} 1633}
1634EXPORT_SYMBOL(get_property); 1634EXPORT_SYMBOL(of_get_property);
1635 1635
1636/* 1636/*
1637 * Add a property to a node 1637 * Add a property to a node
@@ -1762,10 +1762,10 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread)
1762 /* Check for ibm,ppc-interrupt-server#s. If it doesn't exist 1762 /* Check for ibm,ppc-interrupt-server#s. If it doesn't exist
1763 * fallback to "reg" property and assume no threads 1763 * fallback to "reg" property and assume no threads
1764 */ 1764 */
1765 intserv = get_property(np, "ibm,ppc-interrupt-server#s", 1765 intserv = of_get_property(np, "ibm,ppc-interrupt-server#s",
1766 &plen); 1766 &plen);
1767 if (intserv == NULL) { 1767 if (intserv == NULL) {
1768 const u32 *reg = get_property(np, "reg", NULL); 1768 const u32 *reg = of_get_property(np, "reg", NULL);
1769 if (reg == NULL) 1769 if (reg == NULL)
1770 continue; 1770 continue;
1771 if (*reg == hardid) { 1771 if (*reg == hardid) {
diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h
index 994de8ea3308..448c5ce76fbe 100644
--- a/include/asm-powerpc/prom.h
+++ b/include/asm-powerpc/prom.h
@@ -165,9 +165,10 @@ extern void early_init_devtree(void *);
165extern int device_is_compatible(const struct device_node *device, 165extern int device_is_compatible(const struct device_node *device,
166 const char *); 166 const char *);
167extern int machine_is_compatible(const char *compat); 167extern int machine_is_compatible(const char *compat);
168extern const void *get_property(const struct device_node *node, 168extern const void *of_get_property(const struct device_node *node,
169 const char *name, 169 const char *name,
170 int *lenp); 170 int *lenp);
171#define get_property(a, b, c) of_get_property((a), (b), (c))
171extern void print_properties(struct device_node *node); 172extern void print_properties(struct device_node *node);
172extern int prom_n_addr_cells(struct device_node* np); 173extern int prom_n_addr_cells(struct device_node* np);
173extern int prom_n_size_cells(struct device_node* np); 174extern int prom_n_size_cells(struct device_node* np);
diff --git a/include/asm-ppc/prom.h b/include/asm-ppc/prom.h
index adc5ae784924..901f7fa8b2d7 100644
--- a/include/asm-ppc/prom.h
+++ b/include/asm-ppc/prom.h
@@ -34,7 +34,8 @@ extern unsigned long sub_reloc_offset(unsigned long);
34 */ 34 */
35#define machine_is_compatible(x) 0 35#define machine_is_compatible(x) 0
36#define of_find_compatible_node(f, t, c) NULL 36#define of_find_compatible_node(f, t, c) NULL
37#define get_property(p, n, l) NULL 37#define of_get_property(p, n, l) NULL
38#define get_property(a, b, c) of_get_property((a), (b), (c))
38 39
39#endif /* _PPC_PROM_H */ 40#endif /* _PPC_PROM_H */
40#endif /* __KERNEL__ */ 41#endif /* __KERNEL__ */