summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-06-07 11:49:24 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-22 11:30:28 +0200
commit8776eca37aca1f8d5d2d7091314989d0cc24b89b (patch)
tree8ed7a9a42a62fcaf1c6e89726d1aea10725d74cf /include
parent5126579f9728f8f35a7e7cb1945cbc544b029655 (diff)
downloadbarebox-8776eca37aca1f8d5d2d7091314989d0cc24b89b.tar.gz
barebox-8776eca37aca1f8d5d2d7091314989d0cc24b89b.tar.xz
globalvar: sync with nvvars
This patch fixes the behaviour when a driver creates a globalvar using globalvar_add_simple_[string|int|bool|enum|ip]) *after* nvvars are initialized and this globalvar is overwritten with a nvvar. Currently this fix is not needed because all globalvars are registered before the nvvars are initialized. We have two different typed of globalvars. The first type, here referred to as qualified globalvars, has a backend variable storage (the ones created with globalvar_add_simple_[string|int|bool|enum|ip]), the other created with globalvar_add_simple only has a dynamically allocted string as backend. Normally during startup of barebox the qualified globalvars are registered and during load of nvvars are synced with the values from the nvvars. Everything works fine in this case. However, when during nvvar initialisation a globalvar for a nvvar does not exist, then it is registered as unqualified globalvar. When then later some driver wants to register a qualified globalvar for which a unqualified globalvar already exists, it will get a -EEXIST. This is not the expected behaviour. Instead, the current unqualified globalvar should be removed, recreated as qualified globalvar and then afterwards synced with the corresponding nvvar. This behaviour is fixed with this patch. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/param.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/param.h b/include/param.h
index 3fb4740b3a..68e08a254e 100644
--- a/include/param.h
+++ b/include/param.h
@@ -6,6 +6,7 @@
#include <linux/list.h>
#define PARAM_FLAG_RO (1 << 0)
+#define PARAM_GLOBALVAR_UNQUALIFIED (1 << 1)
struct device_d;
typedef uint32_t IPaddr_t;