Commit 0e56efc7 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Paul Mackerras

[POWERPC] Rename get_property to of_get_property

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: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent a7edd0e6
...@@ -400,8 +400,8 @@ static unsigned long __init unflatten_dt_node(unsigned long mem, ...@@ -400,8 +400,8 @@ static unsigned long __init unflatten_dt_node(unsigned long mem,
} }
if (allnextpp) { if (allnextpp) {
*prev_pp = NULL; *prev_pp = NULL;
np->name = get_property(np, "name", NULL); np->name = of_get_property(np, "name", NULL);
np->type = get_property(np, "device_type", NULL); np->type = of_get_property(np, "device_type", NULL);
if (!np->name) if (!np->name)
np->name = "<NULL>"; np->name = "<NULL>";
...@@ -1048,7 +1048,7 @@ prom_n_addr_cells(struct device_node* np) ...@@ -1048,7 +1048,7 @@ prom_n_addr_cells(struct device_node* np)
do { do {
if (np->parent) if (np->parent)
np = np->parent; np = np->parent;
ip = get_property(np, "#address-cells", NULL); ip = of_get_property(np, "#address-cells", NULL);
if (ip != NULL) if (ip != NULL)
return *ip; return *ip;
} while (np->parent); } while (np->parent);
...@@ -1064,7 +1064,7 @@ prom_n_size_cells(struct device_node* np) ...@@ -1064,7 +1064,7 @@ prom_n_size_cells(struct device_node* np)
do { do {
if (np->parent) if (np->parent)
np = np->parent; np = np->parent;
ip = get_property(np, "#size-cells", NULL); ip = of_get_property(np, "#size-cells", NULL);
if (ip != NULL) if (ip != NULL)
return *ip; return *ip;
} while (np->parent); } while (np->parent);
...@@ -1136,7 +1136,7 @@ int device_is_compatible(const struct device_node *device, const char *compat) ...@@ -1136,7 +1136,7 @@ int device_is_compatible(const struct device_node *device, const char *compat)
const char* cp; const char* cp;
int cplen, l; int cplen, l;
cp = get_property(device, "compatible", &cplen); cp = of_get_property(device, "compatible", &cplen);
if (cp == NULL) if (cp == NULL)
return 0; return 0;
while (cplen > 0) { while (cplen > 0) {
...@@ -1547,8 +1547,8 @@ static int of_finish_dynamic_node(struct device_node *node) ...@@ -1547,8 +1547,8 @@ static int of_finish_dynamic_node(struct device_node *node)
int err = 0; int err = 0;
const phandle *ibm_phandle; const phandle *ibm_phandle;
node->name = get_property(node, "name", NULL); node->name = of_get_property(node, "name", NULL);
node->type = get_property(node, "device_type", NULL); node->type = of_get_property(node, "device_type", NULL);
if (!parent) { if (!parent) {
err = -ENODEV; err = -ENODEV;
...@@ -1562,7 +1562,7 @@ static int of_finish_dynamic_node(struct device_node *node) ...@@ -1562,7 +1562,7 @@ static int of_finish_dynamic_node(struct device_node *node)
return -ENODEV; return -ENODEV;
/* fix up new node's linux_phandle field */ /* 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; node->linux_phandle = *ibm_phandle;
out: out:
...@@ -1625,13 +1625,13 @@ EXPORT_SYMBOL(of_find_property); ...@@ -1625,13 +1625,13 @@ EXPORT_SYMBOL(of_find_property);
* Find a property with a given name for a given node * Find a property with a given name for a given node
* and return the value. * 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) int *lenp)
{ {
struct property *pp = of_find_property(np,name,lenp); struct property *pp = of_find_property(np,name,lenp);
return pp ? pp->value : NULL; return pp ? pp->value : NULL;
} }
EXPORT_SYMBOL(get_property); EXPORT_SYMBOL(of_get_property);
/* /*
* Add a property to a node * Add a property to a node
...@@ -1762,10 +1762,10 @@ struct device_node *of_get_cpu_node(int cpu, unsigned int *thread) ...@@ -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 /* Check for ibm,ppc-interrupt-server#s. If it doesn't exist
* fallback to "reg" property and assume no threads * 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); &plen);
if (intserv == NULL) { if (intserv == NULL) {
const u32 *reg = get_property(np, "reg", NULL); const u32 *reg = of_get_property(np, "reg", NULL);
if (reg == NULL) if (reg == NULL)
continue; continue;
if (*reg == hardid) { if (*reg == hardid) {
......
...@@ -165,9 +165,10 @@ extern void early_init_devtree(void *); ...@@ -165,9 +165,10 @@ extern void early_init_devtree(void *);
extern int device_is_compatible(const struct device_node *device, extern int device_is_compatible(const struct device_node *device,
const char *); const char *);
extern int machine_is_compatible(const char *compat); 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, const char *name,
int *lenp); int *lenp);
#define get_property(a, b, c) of_get_property((a), (b), (c))
extern void print_properties(struct device_node *node); extern void print_properties(struct device_node *node);
extern int prom_n_addr_cells(struct device_node* np); extern int prom_n_addr_cells(struct device_node* np);
extern int prom_n_size_cells(struct device_node* np); extern int prom_n_size_cells(struct device_node* np);
......
...@@ -34,7 +34,8 @@ extern unsigned long sub_reloc_offset(unsigned long); ...@@ -34,7 +34,8 @@ extern unsigned long sub_reloc_offset(unsigned long);
*/ */
#define machine_is_compatible(x) 0 #define machine_is_compatible(x) 0
#define of_find_compatible_node(f, t, c) NULL #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 /* _PPC_PROM_H */
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment