Commit f7785a64 authored by Bob Breuer's avatar Bob Breuer Committed by David S. Miller

[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: default avatarDavid S. Miller <davem@davemloft.net>
parent bda2f7b4
...@@ -444,6 +444,7 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s ...@@ -444,6 +444,7 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s
static struct property *tmp = NULL; static struct property *tmp = NULL;
struct property *p; struct property *p;
int len; int len;
const char *name;
if (tmp) { if (tmp) {
p = tmp; p = tmp;
...@@ -456,19 +457,21 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s ...@@ -456,19 +457,21 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s
p->name = (char *) (p + 1); p->name = (char *) (p + 1);
if (special_name) { if (special_name) {
strcpy(p->name, special_name);
p->length = special_len; p->length = special_len;
p->value = prom_early_alloc(special_len); p->value = prom_early_alloc(special_len);
memcpy(p->value, special_val, special_len); memcpy(p->value, special_val, special_len);
} else { } else {
if (prev == NULL) { if (prev == NULL) {
prom_firstprop(node, p->name); name = prom_firstprop(node, NULL);
} else { } else {
prom_nextprop(node, prev, p->name); name = prom_nextprop(node, prev, NULL);
} }
if (strlen(p->name) == 0) { if (strlen(name) == 0) {
tmp = p; tmp = p;
return NULL; return NULL;
} }
strcpy(p->name, name);
p->length = prom_getproplen(node, p->name); p->length = prom_getproplen(node, p->name);
if (p->length <= 0) { if (p->length <= 0) {
p->length = 0; p->length = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment