summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-02-12 09:27:35 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-03-02 07:54:13 +0100
commite7e39180ad01e279d5f3ab2f78ce319dc8ab51fc (patch)
tree6f3dadf6eac02f94556efdd80d0b9ef23ba45ef0
parentdb228127ba97e4dcb091caebdbeb9df4335e0894 (diff)
downloadbarebox-e7e39180ad01e279d5f3ab2f78ce319dc8ab51fc.tar.gz
reset_source: make safe to call earlier
reset_source_init used to set the reset source to unknown in a coredevice_initcall. This means if reset_source_set() has been called earlier the value would have been overwritten. Fix this by calling globalvar_add_simple() each time reset_source_set() is called. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/reset_source.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/reset_source.c b/common/reset_source.c
index 946670b..0147b5c 100644
--- a/common/reset_source.c
+++ b/common/reset_source.c
@@ -40,14 +40,14 @@ void reset_source_set(enum reset_src_type st)
{
reset_source = st;
- setenv("global.system.reset", reset_src_names[st]);
+ globalvar_add_simple("system.reset", reset_src_names[reset_source]);
}
EXPORT_SYMBOL(reset_source_set);
/* ensure this runs after the 'global' device is already registerd */
static int reset_source_init(void)
{
- globalvar_add_simple("system.reset", reset_src_names[RESET_UKWN]);
+ reset_source_set(reset_source);
return 0;
}