aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel
diff options
context:
space:
mode:
authorBob Breuer <breuerr@mc.net>2006-07-17 20:05:56 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-07-21 17:18:04 -0400
commitf7785a64d117951e4c2bf9418d8c1dd59fe53b36 (patch)
tree47a563ea748f158a024f47a5b1c519329e61f599 /arch/sparc/kernel
parentbda2f7b4801964351253706d1a87e4d2110829a5 (diff)
[SPARC]: Fix property name acquisition in prom.c
On sparc32 the prom_{first,next}prop() interfaces work a little differently. The buffer argument is ignored on sparc32 and the firmware just returns a raw pointer to the property name. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/kernel')
-rw-r--r--arch/sparc/kernel/prom.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index 4b06dcb00ebd..4ca9e5fc97f4 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -444,6 +444,7 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s
444 static struct property *tmp = NULL; 444 static struct property *tmp = NULL;
445 struct property *p; 445 struct property *p;
446 int len; 446 int len;
447 const char *name;
447 448
448 if (tmp) { 449 if (tmp) {
449 p = tmp; 450 p = tmp;
@@ -456,19 +457,21 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s
456 457
457 p->name = (char *) (p + 1); 458 p->name = (char *) (p + 1);
458 if (special_name) { 459 if (special_name) {
460 strcpy(p->name, special_name);
459 p->length = special_len; 461 p->length = special_len;
460 p->value = prom_early_alloc(special_len); 462 p->value = prom_early_alloc(special_len);
461 memcpy(p->value, special_val, special_len); 463 memcpy(p->value, special_val, special_len);
462 } else { 464 } else {
463 if (prev == NULL) { 465 if (prev == NULL) {
464 prom_firstprop(node, p->name); 466 name = prom_firstprop(node, NULL);
465 } else { 467 } else {
466 prom_nextprop(node, prev, p->name); 468 name = prom_nextprop(node, prev, NULL);
467 } 469 }
468 if (strlen(p->name) == 0) { 470 if (strlen(name) == 0) {
469 tmp = p; 471 tmp = p;
470 return NULL; 472 return NULL;
471 } 473 }
474 strcpy(p->name, name);
472 p->length = prom_getproplen(node, p->name); 475 p->length = prom_getproplen(node, p->name);
473 if (p->length <= 0) { 476 if (p->length <= 0) {
474 p->length = 0; 477 p->length = 0;