diff options
| -rw-r--r-- | arch/sparc64/kernel/prom.c | 11 | ||||
| -rw-r--r-- | include/asm-sparc64/prom.h | 10 |
2 files changed, 13 insertions, 8 deletions
diff --git a/arch/sparc64/kernel/prom.c b/arch/sparc64/kernel/prom.c index 13734b50a6e8..5e1fcd05160d 100644 --- a/arch/sparc64/kernel/prom.c +++ b/arch/sparc64/kernel/prom.c | |||
| @@ -36,12 +36,13 @@ static struct device_node *allnodes; | |||
| 36 | */ | 36 | */ |
| 37 | static DEFINE_RWLOCK(devtree_lock); | 37 | static DEFINE_RWLOCK(devtree_lock); |
| 38 | 38 | ||
| 39 | int of_device_is_compatible(struct device_node *device, const char *compat) | 39 | int of_device_is_compatible(const struct device_node *device, |
| 40 | const char *compat) | ||
| 40 | { | 41 | { |
| 41 | const char* cp; | 42 | const char* cp; |
| 42 | int cplen, l; | 43 | int cplen, l; |
| 43 | 44 | ||
| 44 | cp = (char *) of_get_property(device, "compatible", &cplen); | 45 | cp = of_get_property(device, "compatible", &cplen); |
| 45 | if (cp == NULL) | 46 | if (cp == NULL) |
| 46 | return 0; | 47 | return 0; |
| 47 | while (cplen > 0) { | 48 | while (cplen > 0) { |
| @@ -154,7 +155,8 @@ struct device_node *of_find_compatible_node(struct device_node *from, | |||
| 154 | } | 155 | } |
| 155 | EXPORT_SYMBOL(of_find_compatible_node); | 156 | EXPORT_SYMBOL(of_find_compatible_node); |
| 156 | 157 | ||
| 157 | struct property *of_find_property(struct device_node *np, const char *name, | 158 | struct property *of_find_property(const struct device_node *np, |
| 159 | const char *name, | ||
| 158 | int *lenp) | 160 | int *lenp) |
| 159 | { | 161 | { |
| 160 | struct property *pp; | 162 | struct property *pp; |
| @@ -174,7 +176,8 @@ EXPORT_SYMBOL(of_find_property); | |||
| 174 | * Find a property with a given name for a given node | 176 | * Find a property with a given name for a given node |
| 175 | * and return the value. | 177 | * and return the value. |
| 176 | */ | 178 | */ |
| 177 | const void *of_get_property(struct device_node *np, const char *name, int *lenp) | 179 | const void *of_get_property(const struct device_node *np, const char *name, |
| 180 | int *lenp) | ||
| 178 | { | 181 | { |
| 179 | struct property *pp = of_find_property(np,name,lenp); | 182 | struct property *pp = of_find_property(np,name,lenp); |
| 180 | return pp ? pp->value : NULL; | 183 | return pp ? pp->value : NULL; |
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h index 50b03387c97b..6394bd1cdcd4 100644 --- a/include/asm-sparc64/prom.h +++ b/include/asm-sparc64/prom.h | |||
| @@ -93,12 +93,14 @@ extern struct device_node *of_find_node_by_phandle(phandle handle); | |||
| 93 | extern struct device_node *of_get_parent(const struct device_node *node); | 93 | extern struct device_node *of_get_parent(const struct device_node *node); |
| 94 | extern struct device_node *of_get_next_child(const struct device_node *node, | 94 | extern struct device_node *of_get_next_child(const struct device_node *node, |
| 95 | struct device_node *prev); | 95 | struct device_node *prev); |
| 96 | extern struct property *of_find_property(struct device_node *np, | 96 | extern struct property *of_find_property(const struct device_node *np, |
| 97 | const char *name, | 97 | const char *name, |
| 98 | int *lenp); | 98 | int *lenp); |
| 99 | extern int of_device_is_compatible(struct device_node *device, const char *); | 99 | extern int of_device_is_compatible(const struct device_node *device, |
| 100 | extern const void *of_get_property(struct device_node *node, const char *name, | 100 | const char *); |
| 101 | int *lenp); | 101 | extern const void *of_get_property(const struct device_node *node, |
| 102 | const char *name, | ||
| 103 | int *lenp); | ||
| 102 | #define get_property(node,name,lenp) of_get_property(node,name,lenp) | 104 | #define get_property(node,name,lenp) of_get_property(node,name,lenp) |
| 103 | extern int of_set_property(struct device_node *node, const char *name, void *val, int len); | 105 | extern int of_set_property(struct device_node *node, const char *name, void *val, int len); |
| 104 | extern int of_getintprop_default(struct device_node *np, | 106 | extern int of_getintprop_default(struct device_node *np, |
