diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2016-06-07 11:03:00 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2016-09-22 11:30:23 +0200 |
commit | 5126579f9728f8f35a7e7cb1945cbc544b029655 (patch) | |
tree | a986a47d48e24f01a864132aacbaceadcbded633 /include | |
parent | c42e8262c827d267be9529da1373efeaf535ec6b (diff) | |
download | barebox-5126579f9728f8f35a7e7cb1945cbc544b029655.tar.gz barebox-5126579f9728f8f35a7e7cb1945cbc544b029655.tar.xz |
globalvar: Move static inline functions to common/
These functions will get bigger in the next patch which disqualifies
them as static inline functions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/globalvar.h | 76 |
1 files changed, 7 insertions, 69 deletions
diff --git a/include/globalvar.h b/include/globalvar.h index 1cd8d21a2e..2322efbfbb 100644 --- a/include/globalvar.h +++ b/include/globalvar.h @@ -18,75 +18,13 @@ 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); -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) -{ - struct param_d *p; - - p = dev_add_param_int(&global_device, name, NULL, NULL, - value, format, NULL); - - if (IS_ERR(p)) - return PTR_ERR(p); - - return 0; -} - -static inline int globalvar_add_simple_bool(const char *name, - int *value) -{ - struct param_d *p; - - p = dev_add_param_bool(&global_device, name, NULL, NULL, - value, NULL); - - if (IS_ERR(p)) - return PTR_ERR(p); - - return 0; -} - -static inline int globalvar_add_simple_enum(const char *name, - int *value, const char * const *names, int max) -{ - struct param_d *p; - - p = dev_add_param_enum(&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) -{ - struct param_d *p; - - p = dev_add_param_ip(&global_device, name, NULL, NULL, - ip, NULL); - - if (IS_ERR(p)) - return PTR_ERR(p); - - return 0; -} +int globalvar_add_simple_string(const char *name, char **value); +int globalvar_add_simple_int(const char *name, int *value, + const char *format); +int globalvar_add_simple_bool(const char *name, int *value); +int globalvar_add_simple_enum(const char *name, int *value, + const char * const *names, int max); +int globalvar_add_simple_ip(const char *name, IPaddr_t *ip); int nvvar_load(void); void nvvar_print(void); |