aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/prom.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/kernel/prom.c')
-rw-r--r--arch/sparc/kernel/prom.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index 2cc302b6bec0..eed140b3c739 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -32,12 +32,13 @@ static struct device_node *allnodes;
32 */ 32 */
33static DEFINE_RWLOCK(devtree_lock); 33static DEFINE_RWLOCK(devtree_lock);
34 34
35int of_device_is_compatible(struct device_node *device, const char *compat) 35int of_device_is_compatible(const struct device_node *device,
36 const char *compat)
36{ 37{
37 const char* cp; 38 const char* cp;
38 int cplen, l; 39 int cplen, l;
39 40
40 cp = (char *) of_get_property(device, "compatible", &cplen); 41 cp = of_get_property(device, "compatible", &cplen);
41 if (cp == NULL) 42 if (cp == NULL)
42 return 0; 43 return 0;
43 while (cplen > 0) { 44 while (cplen > 0) {
@@ -150,13 +151,14 @@ struct device_node *of_find_compatible_node(struct device_node *from,
150} 151}
151EXPORT_SYMBOL(of_find_compatible_node); 152EXPORT_SYMBOL(of_find_compatible_node);
152 153
153struct property *of_find_property(struct device_node *np, const char *name, 154struct property *of_find_property(const struct device_node *np,
155 const char *name,
154 int *lenp) 156 int *lenp)
155{ 157{
156 struct property *pp; 158 struct property *pp;
157 159
158 for (pp = np->properties; pp != 0; pp = pp->next) { 160 for (pp = np->properties; pp != 0; pp = pp->next) {
159 if (strcmp(pp->name, name) == 0) { 161 if (strcasecmp(pp->name, name) == 0) {
160 if (lenp != 0) 162 if (lenp != 0)
161 *lenp = pp->length; 163 *lenp = pp->length;
162 break; 164 break;
@@ -170,7 +172,8 @@ EXPORT_SYMBOL(of_find_property);
170 * Find a property with a given name for a given node 172 * Find a property with a given name for a given node
171 * and return the value. 173 * and return the value.
172 */ 174 */
173void *of_get_property(struct device_node *np, const char *name, int *lenp) 175const void *of_get_property(const struct device_node *np, const char *name,
176 int *lenp)
174{ 177{
175 struct property *pp = of_find_property(np,name,lenp); 178 struct property *pp = of_find_property(np,name,lenp);
176 return pp ? pp->value : NULL; 179 return pp ? pp->value : NULL;
@@ -192,7 +195,7 @@ EXPORT_SYMBOL(of_getintprop_default);
192 195
193int of_n_addr_cells(struct device_node *np) 196int of_n_addr_cells(struct device_node *np)
194{ 197{
195 int* ip; 198 const int* ip;
196 do { 199 do {
197 if (np->parent) 200 if (np->parent)
198 np = np->parent; 201 np = np->parent;
@@ -207,7 +210,7 @@ EXPORT_SYMBOL(of_n_addr_cells);
207 210
208int of_n_size_cells(struct device_node *np) 211int of_n_size_cells(struct device_node *np)
209{ 212{
210 int* ip; 213 const int* ip;
211 do { 214 do {
212 if (np->parent) 215 if (np->parent)
213 np = np->parent; 216 np = np->parent;
@@ -239,7 +242,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
239 while (*prevp) { 242 while (*prevp) {
240 struct property *prop = *prevp; 243 struct property *prop = *prevp;
241 244
242 if (!strcmp(prop->name, name)) { 245 if (!strcasecmp(prop->name, name)) {
243 void *old_val = prop->value; 246 void *old_val = prop->value;
244 int ret; 247 int ret;
245 248