mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/6] globalvar: Allow to remove globalvars
Date: Fri, 29 Apr 2016 11:52:00 +0200	[thread overview]
Message-ID: <1461923525-6356-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1461923525-6356-1-git-send-email-s.hauer@pengutronix.de>

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 common/globalvar.c  | 10 ++++++++++
 include/globalvar.h |  1 +
 2 files changed, 11 insertions(+)

diff --git a/common/globalvar.c b/common/globalvar.c
index 9a793ac..05c3e79 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -33,6 +33,16 @@ int globalvar_add(const char *name,
 	return 0;
 }
 
+void globalvar_remove(const char *name)
+{
+	struct param_d *param = get_param_by_name(&global_device, name);
+
+	if (!param)
+		return;
+
+	dev_remove_param(param);
+}
+
 static int nv_save(const char *name, const char *val)
 {
 	int fd, ret;
diff --git a/include/globalvar.h b/include/globalvar.h
index e77209b..d0c79c0 100644
--- a/include/globalvar.h
+++ b/include/globalvar.h
@@ -14,6 +14,7 @@ int globalvar_add(const char *name,
 		int (*set)(struct device_d *dev, struct param_d *p, const char *val),
 		const char *(*get)(struct device_d *, struct param_d *p),
 		unsigned long flags);
+void globalvar_remove(const char *name);
 char *globalvar_get_match(const char *match, const char *separator);
 void globalvar_set_match(const char *match, const char *val);
 
-- 
2.8.0.rc3


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

  reply	other threads:[~2016-04-29  9:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-29  9:51 Sascha Hauer
2016-04-29  9:52 ` Sascha Hauer [this message]
2016-04-29  9:52 ` [PATCH 2/6] string: Introduce strtobool Sascha Hauer
2016-04-29  9:52 ` [PATCH 3/6] getenv_bool: use strtobool Sascha Hauer
2016-04-29  9:52 ` [PATCH 4/6] parameter: Use strtobool Sascha Hauer
2016-04-29  9:52 ` [PATCH 5/6] bootm: Optionally add a root= option to Kernel command line Sascha Hauer
2016-04-29  9:52 ` [PATCH 6/6] blspec: push appendroot handling to bootm Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461923525-6356-2-git-send-email-s.hauer@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox