summaryrefslogtreecommitdiffstats
path: root/lib/parameter.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2012-04-29 19:06:48 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-05-13 14:02:03 +0200
commit8cab6a873356c988cddf7763cbe4797fad236ba4 (patch)
tree189781c1382cd4e2316ed7b1294b67561833c9f7 /lib/parameter.c
parent0c5554919cb95d7e8c523882f2ede19977f1998c (diff)
downloadbarebox-8cab6a873356c988cddf7763cbe4797fad236ba4.tar.gz
barebox-8cab6a873356c988cddf7763cbe4797fad236ba4.tar.xz
parameter: return empty string for unset parameters
Currently we return NULL for unset parameters. As we can't set them back to NULL once set this is not very consistent. Return an empty string instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'lib/parameter.c')
-rw-r--r--lib/parameter.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/parameter.c b/lib/parameter.c
index baf7720cb4..c75c21e768 100644
--- a/lib/parameter.c
+++ b/lib/parameter.c
@@ -135,7 +135,7 @@ int dev_param_set_generic(struct device_d *dev, struct param_d *p,
static const char *param_get_generic(struct device_d *dev, struct param_d *p)
{
- return p->value;
+ return p->value ? p->value : "";
}
static struct param_d *__dev_add_param(struct device_d *dev, const char *name,