From: Sascha Hauer <s.hauer@pengutronix.de>
To: Barebox List <barebox@lists.infradead.org>
Subject: [PATCH 1/6] Add globalvar_add_simple_string function
Date: Thu, 18 Jun 2015 09:43:39 +0200 [thread overview]
Message-ID: <1434613424-19989-2-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1434613424-19989-1-git-send-email-s.hauer@pengutronix.de>
This adds a globalvar string function to pass a pointer to a string.
With this we can directly access the string to get the variable and
don't have to getenv() the string first.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
include/globalvar.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/include/globalvar.h b/include/globalvar.h
index 8b2caf1..6e10956 100644
--- a/include/globalvar.h
+++ b/include/globalvar.h
@@ -17,6 +17,20 @@ int globalvar_add(const char *name,
char *globalvar_get_match(const char *match, const char *separator);
void globalvar_set_match(const char *match, const char *val);
+static inline int globalvar_add_simple_string(const char *name,
+ char **value)
+{
+ struct param_d *p;
+
+ p = dev_add_param_string(&global_device, name, NULL, NULL,
+ value, NULL);
+
+ if (IS_ERR(p))
+ return PTR_ERR(p);
+
+ return 0;
+}
+
static inline int globalvar_add_simple_int(const char *name,
int *value, const char *format)
{
@@ -85,6 +99,11 @@ static inline int globalvar_add_simple(const char *name, const char *value)
return 0;
}
+static inline int globalvar_add_simple_string(const char *name, char **value)
+{
+ return 0;
+}
+
static inline int globalvar_add_simple_int(const char *name,
int *value, const char *format)
{
--
2.1.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2015-06-18 7:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-18 7:43 Bootspec: Allow to automatically append root= option Sascha Hauer
2015-06-18 7:43 ` Sascha Hauer [this message]
2015-06-18 7:43 ` [PATCH 2/6] cdev: Add partuuid string to struct cdev Sascha Hauer
2015-06-18 7:43 ` [PATCH 3/6] fs: Add device parameter for Linux root= option Sascha Hauer
2015-06-18 7:43 ` [PATCH 4/6] fs: ubifs: Implement Linux rootarg Sascha Hauer
2015-06-18 7:43 ` [PATCH 5/6] fs: nfs: " Sascha Hauer
2015-06-18 7:43 ` [PATCH 6/6] blspec: Automatically append rootarg Sascha Hauer
2015-06-30 7:26 ` Marc Kleine-Budde
2015-07-01 6:58 ` Sascha Hauer
2015-07-01 7:22 ` Marc Kleine-Budde
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=1434613424-19989-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