diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/globalvar.c | 12 | ||||
-rw-r--r-- | common/reset_source.c | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/common/globalvar.c b/common/globalvar.c index abcd881adf..6fd1d88522 100644 --- a/common/globalvar.c +++ b/common/globalvar.c @@ -2,6 +2,8 @@ #include <malloc.h> #include <globalvar.h> #include <init.h> +#include <environment.h> +#include <generated/utsrelease.h> static struct device_d global_device = { .name = "global", @@ -61,9 +63,15 @@ void globalvar_set_match(const char *match, const char *val) * * add a new globalvar named 'name' */ -int globalvar_add_simple(const char *name) +int globalvar_add_simple(const char *name, const char *value) { - return globalvar_add(name, NULL, NULL, 0); + int ret; + + ret = globalvar_add(name, NULL, NULL, 0); + if (ret && ret != -EEXIST) + return ret; + + return dev_set_param(&global_device, name, value); } static int globalvar_init(void) diff --git a/common/reset_source.c b/common/reset_source.c index 2a7f9ff6cc..fdc30f4853 100644 --- a/common/reset_source.c +++ b/common/reset_source.c @@ -36,8 +36,8 @@ EXPORT_SYMBOL(set_reset_source); /* ensure this runs after the 'global' device is already registerd */ static int init_reset_source(void) { - globalvar_add_simple("system.reset"); - set_reset_source(RESET_UKWN); + globalvar_add_simple("system.reset", reset_src_names[RESET_UKWN]); + return 0; } |