[PATCH 2/2] globalvar: Allow full variable name in globalvar_add

Sascha Hauer s.hauer at pengutronix.de
Thu Sep 22 02:13:35 PDT 2016


As a convenience for users allow to pass the full name, including
the leading "global.", to globalvar_add().

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/globalvar.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/common/globalvar.c b/common/globalvar.c
index 6466d1d..d6a46de 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -36,6 +36,9 @@ int globalvar_add(const char *name,
 {
 	struct param_d *param;
 
+	if (!strncmp(name, "global.", 7))
+		name += 7;
+
 	param = dev_add_param(&global_device, name, set, get, flags);
 	if (IS_ERR(param))
 		return PTR_ERR(param);
-- 
2.8.1




More information about the barebox mailing list