diff options
author | Bob Breuer <breuerr@mc.net> | 2006-07-17 17:05:56 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-07-21 14:18:04 -0700 |
commit | f7785a64d117951e4c2bf9418d8c1dd59fe53b36 (patch) | |
tree | 47a563ea748f158a024f47a5b1c519329e61f599 /arch | |
parent | bda2f7b4801964351253706d1a87e4d2110829a5 (diff) | |
download | linux-f7785a64d117951e4c2bf9418d8c1dd59fe53b36.tar.gz linux-f7785a64d117951e4c2bf9418d8c1dd59fe53b36.tar.bz2 linux-f7785a64d117951e4c2bf9418d8c1dd59fe53b36.zip |
[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')
-rw-r--r-- | arch/sparc/kernel/prom.c | 9 |
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 static struct property *tmp = NULL; struct property *p; int len; + const char *name; if (tmp) { p = tmp; @@ -456,19 +457,21 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s p->name = (char *) (p + 1); if (special_name) { + strcpy(p->name, special_name); p->length = special_len; p->value = prom_early_alloc(special_len); memcpy(p->value, special_val, special_len); } else { if (prev == NULL) { - prom_firstprop(node, p->name); + name = prom_firstprop(node, NULL); } else { - prom_nextprop(node, prev, p->name); + name = prom_nextprop(node, prev, NULL); } - if (strlen(p->name) == 0) { + if (strlen(name) == 0) { tmp = p; return NULL; } + strcpy(p->name, name); p->length = prom_getproplen(node, p->name); if (p->length <= 0) { p->length = 0; |