Commit 47cd5265ea8fe0b246bfd9b42ba69e13aa8b99bd

Authored by Julian Calaby
Committed by David S. Miller
1 parent 192eee8ef5

sparc: Clean arch-specific code in prom_common.c

prom_nextprop() and prom_firstprop() have slightly different calling
conventions in 32 and 64 bit SPARC.

prom_common.c uses a ifdef guard to ensure that these functions are
called correctly.

Adjust code to eliminate this ifdef by using a calling convention that
is compatible with both 32 and 64 bit SPARC.

Signed-off-by: Julian Calaby <julian.calaby@gmail.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

Showing 1 changed file with 3 additions and 11 deletions Side-by-side Diff

arch/sparc/kernel/prom_common.c
... ... @@ -155,20 +155,12 @@
155 155 p->value = prom_early_alloc(special_len);
156 156 memcpy(p->value, special_val, special_len);
157 157 } else {
158   -#ifdef CONFIG_SPARC32
159 158 if (prev == NULL) {
160   - name = prom_firstprop(node, NULL);
  159 + name = prom_firstprop(node, p->name);
161 160 } else {
162   - name = prom_nextprop(node, prev, NULL);
  161 + name = prom_nextprop(node, prev, p->name);
163 162 }
164   -#else
165   - if (prev == NULL) {
166   - prom_firstprop(node, p->name);
167   - } else {
168   - prom_nextprop(node, prev, p->name);
169   - }
170   - name = p->name;
171   -#endif
  163 +
172 164 if (strlen(name) == 0) {
173 165 tmp = p;
174 166 return NULL;