diff options
Diffstat (limited to 'arch/sparc/prom/tree_32.c')
-rw-r--r-- | arch/sparc/prom/tree_32.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/arch/sparc/prom/tree_32.c b/arch/sparc/prom/tree_32.c index bc8e4cb87a68..f30e8d038f01 100644 --- a/arch/sparc/prom/tree_32.c +++ b/arch/sparc/prom/tree_32.c | |||
@@ -40,11 +40,11 @@ phandle prom_getchild(phandle node) | |||
40 | { | 40 | { |
41 | phandle cnode; | 41 | phandle cnode; |
42 | 42 | ||
43 | if (node == -1) | 43 | if ((s32)node == -1) |
44 | return 0; | 44 | return 0; |
45 | 45 | ||
46 | cnode = __prom_getchild(node); | 46 | cnode = __prom_getchild(node); |
47 | if (cnode == 0 || cnode == -1) | 47 | if (cnode == 0 || (s32)cnode == -1) |
48 | return 0; | 48 | return 0; |
49 | 49 | ||
50 | return cnode; | 50 | return cnode; |
@@ -72,11 +72,11 @@ phandle prom_getsibling(phandle node) | |||
72 | { | 72 | { |
73 | phandle sibnode; | 73 | phandle sibnode; |
74 | 74 | ||
75 | if (node == -1) | 75 | if ((s32)node == -1) |
76 | return 0; | 76 | return 0; |
77 | 77 | ||
78 | sibnode = __prom_getsibling(node); | 78 | sibnode = __prom_getsibling(node); |
79 | if (sibnode == 0 || sibnode == -1) | 79 | if (sibnode == 0 || (s32)sibnode == -1) |
80 | return 0; | 80 | return 0; |
81 | 81 | ||
82 | return sibnode; | 82 | return sibnode; |
@@ -219,7 +219,7 @@ static char *__prom_nextprop(phandle node, char * oprop) | |||
219 | */ | 219 | */ |
220 | char *prom_nextprop(phandle node, char *oprop, char *buffer) | 220 | char *prom_nextprop(phandle node, char *oprop, char *buffer) |
221 | { | 221 | { |
222 | if (node == 0 || node == -1) | 222 | if (node == 0 || (s32)node == -1) |
223 | return ""; | 223 | return ""; |
224 | 224 | ||
225 | return __prom_nextprop(node, oprop); | 225 | return __prom_nextprop(node, oprop); |
@@ -253,7 +253,7 @@ phandle prom_finddevice(char *name) | |||
253 | if (d != s + 3 && (!*d || *d == '/') | 253 | if (d != s + 3 && (!*d || *d == '/') |
254 | && d <= s + 3 + 8) { | 254 | && d <= s + 3 + 8) { |
255 | node2 = node; | 255 | node2 = node; |
256 | while (node2 && node2 != -1) { | 256 | while (node2 && (s32)node2 != -1) { |
257 | if (prom_getproperty (node2, "reg", (char *)reg, sizeof (reg)) > 0) { | 257 | if (prom_getproperty (node2, "reg", (char *)reg, sizeof (reg)) > 0) { |
258 | if (which_io == reg[0].which_io && phys_addr == reg[0].phys_addr) { | 258 | if (which_io == reg[0].which_io && phys_addr == reg[0].phys_addr) { |
259 | node = node2; | 259 | node = node2; |
@@ -261,7 +261,7 @@ phandle prom_finddevice(char *name) | |||
261 | } | 261 | } |
262 | } | 262 | } |
263 | node2 = prom_getsibling(node2); | 263 | node2 = prom_getsibling(node2); |
264 | if (!node2 || node2 == -1) | 264 | if (!node2 || (s32)node2 == -1) |
265 | break; | 265 | break; |
266 | node2 = prom_searchsiblings(prom_getsibling(node2), nbuf); | 266 | node2 = prom_searchsiblings(prom_getsibling(node2), nbuf); |
267 | } | 267 | } |
@@ -303,6 +303,7 @@ phandle prom_inst2pkg(int inst) | |||
303 | node = (*romvec->pv_v2devops.v2_inst2pkg)(inst); | 303 | node = (*romvec->pv_v2devops.v2_inst2pkg)(inst); |
304 | restore_current(); | 304 | restore_current(); |
305 | spin_unlock_irqrestore(&prom_lock, flags); | 305 | spin_unlock_irqrestore(&prom_lock, flags); |
306 | if (node == -1) return 0; | 306 | if ((s32)node == -1) |
307 | return 0; | ||
307 | return node; | 308 | return node; |
308 | } | 309 | } |