summaryrefslogtreecommitdiffstats
path: root/common/bootchooser.c
diff options
context:
space:
mode:
authorJuergen Borleis <jbe@pengutronix.de>2017-08-15 15:46:33 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-09-06 14:01:53 +0200
commiteaf9a86d1ccac59bc7f8b9731f50553a055c3b02 (patch)
tree545aaffbb689315a0af00cd96f8b0923edb27549 /common/bootchooser.c
parent9f91974e299a68c83cefafa35f11bcdbb4b9a5f7 (diff)
downloadbarebox-eaf9a86d1ccac59bc7f8b9731f50553a055c3b02.tar.gz
barebox-eaf9a86d1ccac59bc7f8b9731f50553a055c3b02.tar.xz
bootchooser: allow an empty namespace
The bootchooser's documentation states the 'namespace' for the state storage backend is optional. This change makes it really optional to allow a flat state variable set definition for the 'bootchooser' as well. Signed-off-by: Juergen Borleis <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/bootchooser.c')
-rw-r--r--common/bootchooser.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/common/bootchooser.c b/common/bootchooser.c
index 69d980d6f9..83b15e0f78 100644
--- a/common/bootchooser.c
+++ b/common/bootchooser.c
@@ -367,12 +367,10 @@ struct bootchooser *bootchooser_get(void)
char *state_devname;
delim = strchr(state_prefix, '.');
- if (!delim) {
- pr_err("state_prefix '%s' has invalid format\n",
- state_prefix);
- goto err;
- }
- state_devname = xstrndup(state_prefix, delim - state_prefix);
+ if (delim)
+ state_devname = xstrndup(state_prefix, delim - state_prefix);
+ else
+ state_devname = xstrdup(state_prefix);
bc->state_prefix = xstrdup(state_prefix);
bc->state = state_by_name(state_devname);
if (!bc->state) {