summaryrefslogtreecommitdiffstats
path: root/include/param.h
diff options
context:
space:
mode:
authorChristian Eggers <ceggers@arri.de>2020-01-23 13:20:45 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-01-27 10:57:42 +0100
commit73dda8a0f7b5f3fdec45b8cb9e936fac79105ab7 (patch)
treead74986e8eaea9a28cb79f6d7797c3f0bed9b47c /include/param.h
parenta28332268849ae13c0fba6d0fd3e6b18b380e214 (diff)
downloadbarebox-73dda8a0f7b5f3fdec45b8cb9e936fac79105ab7.tar.gz
barebox-73dda8a0f7b5f3fdec45b8cb9e936fac79105ab7.tar.xz
parameter: Return NULL instead of ENOSYS if CONFIG_PARAMETER is disabled
This reverts 03b59bdb64 ("paramter: The dev_add_param_*() return ERR_PTR(), change no-ops to return ERR_PTR(-ENOSYS) instead of NULL"). Most callers of dev_add_param_*() don't care about whether CONFIG_PARAMETER is enabled or not. The remaining ones have already been prepared for getting a NULL pointer. As a result, these callers will not fail itself, only because CONFIG_PARAMETER (which is always optional) is disabled. Signed-off-by: Christian Eggers <ceggers@arri.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/param.h')
-rw-r--r--include/param.h20
1 files changed, 10 insertions, 10 deletions
diff --git a/include/param.h b/include/param.h
index d75f50ea3e..bfcded1f81 100644
--- a/include/param.h
+++ b/include/param.h
@@ -118,7 +118,7 @@ static inline struct param_d *dev_add_param(struct device_d *dev, const char *na
const char *(*get)(struct device_d *, struct param_d *p),
unsigned long flags)
{
- return ERR_PTR(-ENOSYS);
+ return NULL;
}
static inline struct param_d *dev_add_param_string(struct device_d *dev, const char *name,
@@ -126,7 +126,7 @@ static inline struct param_d *dev_add_param_string(struct device_d *dev, const c
int (*get)(struct param_d *p, void *priv),
char **value, void *priv)
{
- return ERR_PTR(-ENOSYS);
+ return NULL;
}
static inline struct param_d *__dev_add_param_int(struct device_d *dev, const char *name,
@@ -134,7 +134,7 @@ static inline struct param_d *__dev_add_param_int(struct device_d *dev, const ch
int (*get)(struct param_d *p, void *priv),
void *value, enum param_type type, const char *format, void *priv)
{
- return ERR_PTR(-ENOSYS);
+ return NULL;
}
static inline struct param_d *dev_add_param_enum(struct device_d *dev, const char *name,
@@ -143,7 +143,7 @@ static inline struct param_d *dev_add_param_enum(struct device_d *dev, const cha
int *value, const char * const *names, int max, void *priv)
{
- return ERR_PTR(-ENOSYS);
+ return NULL;
}
static inline struct param_d *dev_add_param_bitmask(struct device_d *dev, const char *name,
@@ -151,7 +151,7 @@ static inline struct param_d *dev_add_param_bitmask(struct device_d *dev, const
int (*get)(struct param_d *p, void *priv),
unsigned long *value, const char * const *names, int max, void *priv)
{
- return ERR_PTR(-ENOSYS);
+ return NULL;
}
static inline struct param_d *dev_add_param_tristate(struct device_d *dev, const char *name,
@@ -159,13 +159,13 @@ static inline struct param_d *dev_add_param_tristate(struct device_d *dev, const
int (*get)(struct param_d *p, void *priv),
int *value, void *priv)
{
- return ERR_PTR(-ENOSYS);
+ return NULL;
}
static inline struct param_d *dev_add_param_tristate_ro(struct device_d *dev, const char *name,
int *value)
{
- return ERR_PTR(-ENOSYS);
+ return NULL;
}
static inline struct param_d *dev_add_param_ip(struct device_d *dev, const char *name,
@@ -173,7 +173,7 @@ static inline struct param_d *dev_add_param_ip(struct device_d *dev, const char
int (*get)(struct param_d *p, void *priv),
IPaddr_t *ip, void *priv)
{
- return ERR_PTR(-ENOSYS);
+ return NULL;
}
static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char *name,
@@ -181,13 +181,13 @@ static inline struct param_d *dev_add_param_mac(struct device_d *dev, const char
int (*get)(struct param_d *p, void *priv),
u8 *mac, void *priv)
{
- return ERR_PTR(-ENOSYS);
+ return NULL;
}
static inline struct param_d *dev_add_param_fixed(struct device_d *dev, const char *name,
const char *value)
{
- return ERR_PTR(-ENOSYS);
+ return NULL;
}
static inline void dev_remove_param(struct param_d *p) {}