Using the just introduced param_bitmask this adds the corresponding
globalvar convenience function.

Signed-off-by: Sascha Hauer <s.ha...@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


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

Reply via email to