summaryrefslogtreecommitdiffstats
path: root/arch/sparc/kernel/prom.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-09 19:35:20 -0700
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-09 19:35:20 -0700
commit1601ff0e29cfe112b06aa9bb2fb3519a1125baaa (patch)
treec618296e804434eb185bdbd5ec45dd92eae2e74d /arch/sparc/kernel/prom.c
parentd942492e1dbce264435daaf40f5742e1aaa5adaf (diff)
parent078830eaa8abccd1e95d3effce5b29273bb5ed09 (diff)
downloadkernel-crypto-1601ff0e29cfe112b06aa9bb2fb3519a1125baaa.tar.gz
kernel-crypto-1601ff0e29cfe112b06aa9bb2fb3519a1125baaa.tar.xz
kernel-crypto-1601ff0e29cfe112b06aa9bb2fb3519a1125baaa.zip
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6: [SPARC32]: Fix prom.c build warning [SPARC64]: Update defconfig. [SPARC64]: Fix of_device bus_id settings. [SPARC64]: Update MAINTAINERS entry.
Diffstat (limited to 'arch/sparc/kernel/prom.c')
-rw-r--r--arch/sparc/kernel/prom.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/sparc/kernel/prom.c b/arch/sparc/kernel/prom.c
index 4ca9e5fc97f..2cc302b6bec 100644
--- a/arch/sparc/kernel/prom.c
+++ b/arch/sparc/kernel/prom.c
@@ -243,7 +243,7 @@ int of_set_property(struct device_node *dp, const char *name, void *val, int len
void *old_val = prop->value;
int ret;
- ret = prom_setprop(dp->node, name, val, len);
+ ret = prom_setprop(dp->node, (char *) name, val, len);
err = -EINVAL;
if (ret >= 0) {
prop->value = new_val;
@@ -477,7 +477,10 @@ static struct property * __init build_one_prop(phandle node, char *prev, char *s
p->length = 0;
} else {
p->value = prom_early_alloc(p->length + 1);
- prom_getproperty(node, p->name, p->value, p->length);
+ len = prom_getproperty(node, p->name, p->value,
+ p->length);
+ if (len <= 0)
+ p->length = 0;
((unsigned char *)p->value)[p->length] = '\0';
}
}