[PATCH 2/2] globalvar: introduce globalvar_add_simple_bitmask
Sascha Hauer
s.hauer at pengutronix.de
Thu Sep 22 02:14:46 PDT 2016
Using the just introduced param_bitmask this adds the corresponding
globalvar convenience function.
Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
include/globalvar.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/include/globalvar.h b/include/globalvar.h
index 1cd8d21..e503207 100644
--- a/include/globalvar.h
+++ b/include/globalvar.h
@@ -74,6 +74,20 @@ static inline int globalvar_add_simple_enum(const char *name,
return 0;
}
+static inline 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;
+}
+
static inline int globalvar_add_simple_ip(const char *name,
IPaddr_t *ip)
{
--
2.8.1
More information about the barebox
mailing list