mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/2] nv: Allow full variable name in nvvar_add
@ 2016-09-22  9:13 Sascha Hauer
  2016-09-22  9:13 ` [PATCH 2/2] globalvar: Allow full variable name in globalvar_add Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Sascha Hauer @ 2016-09-22  9:13 UTC (permalink / raw)
  To: Barebox List

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

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

diff --git a/common/globalvar.c b/common/globalvar.c
index a2555cf..6466d1d 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -240,6 +240,9 @@ int nvvar_add(const char *name, const char *value)
 {
 	int ret;
 
+	if (!strncmp(name, "nv.", 3))
+		name += 3;
+
 	ret = __nvvar_add(name, value);
 	if (ret)
 		return ret;
-- 
2.8.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 2/2] globalvar: Allow full variable name in globalvar_add
  2016-09-22  9:13 [PATCH 1/2] nv: Allow full variable name in nvvar_add Sascha Hauer
@ 2016-09-22  9:13 ` Sascha Hauer
  0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2016-09-22  9:13 UTC (permalink / raw)
  To: Barebox List

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@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-09-22  9:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-22  9:13 [PATCH 1/2] nv: Allow full variable name in nvvar_add Sascha Hauer
2016-09-22  9:13 ` [PATCH 2/2] globalvar: Allow full variable name in globalvar_add Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox