summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2016-09-12 15:02:55 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2016-09-22 11:35:00 +0200
commit6d8beeaad1e1133ae48664223793394310b1db46 (patch)
treeb8f80d6ac978d8125cb7ca51ef84bcb04454e390 /common
parent18697b7afcfb1688920b3eede30b85064b7b5b54 (diff)
downloadbarebox-6d8beeaad1e1133ae48664223793394310b1db46.tar.gz
barebox-6d8beeaad1e1133ae48664223793394310b1db46.tar.xz
globalvar: introduce globalvar_add_simple_bitmask
Using the just introduced param_bitmask this adds the corresponding globalvar convenience function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common')
-rw-r--r--common/globalvar.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/common/globalvar.c b/common/globalvar.c
index 6dde1f82ec..fb69db973a 100644
--- a/common/globalvar.c
+++ b/common/globalvar.c
@@ -529,6 +529,20 @@ int globalvar_add_simple_enum(const char *name, int *value,
return 0;
}
+int globalvar_add_simple_bitmask(const char *name, unsigned long *value,
+ const char * const *names, int max)
+{
+ struct param_d *p;
+
+ p = dev_add_param_bitmask(&global_device, name, NULL, NULL,
+ value, names, max, NULL);
+
+ if (IS_ERR(p))
+ return PTR_ERR(p);
+
+ return 0;
+}
+
int globalvar_add_simple_ip(const char *name, IPaddr_t *ip)
{
struct param_d *p;