globalvar: Do not modify already existing variables
When globalvar_add_simple was called on previously existing variables then the value was overwritten, even when value was passed as NULL. Do not overwrite the value in this case which allows us to do a 'global' on the same variable multiple times without loosing the values. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
61d6a8485d
commit
4973077872
|
@ -72,6 +72,9 @@ int globalvar_add_simple(const char *name, const char *value)
|
|||
if (ret && ret != -EEXIST)
|
||||
return ret;
|
||||
|
||||
if (!value)
|
||||
return 0;
|
||||
|
||||
return dev_set_param(&global_device, name, value);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue