diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-12-26 14:51:09 -0500 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2013-02-15 13:01:56 -0500 |
commit | ee7e2f3c235f43d815c0be285101b5b91a3bcaa5 (patch) | |
tree | 6ffcb4e4e9ba2c48c57f6a76f840a2403fb9f2ea /arch/mips | |
parent | bb76563214ec371a461ca5038904a5b93dbd6b46 (diff) |
MIPS: BCM47XX: use common error codes in nvram reads
Instead of using our own error codes use some common codes.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Patchwork: http://patchwork.linux-mips.org/patch/4739/
Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/bcm47xx/nvram.c | 4 | ||||
-rw-r--r-- | arch/mips/bcm47xx/sprom.c | 2 | ||||
-rw-r--r-- | arch/mips/include/asm/mach-bcm47xx/nvram.h | 3 |
3 files changed, 3 insertions, 6 deletions
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c index 64613678ce84..e19fc2600b76 100644 --- a/arch/mips/bcm47xx/nvram.c +++ b/arch/mips/bcm47xx/nvram.c | |||
@@ -124,7 +124,7 @@ int nvram_getenv(char *name, char *val, size_t val_len) | |||
124 | char *var, *value, *end, *eq; | 124 | char *var, *value, *end, *eq; |
125 | 125 | ||
126 | if (!name) | 126 | if (!name) |
127 | return NVRAM_ERR_INV_PARAM; | 127 | return -EINVAL; |
128 | 128 | ||
129 | if (!nvram_buf[0]) | 129 | if (!nvram_buf[0]) |
130 | early_nvram_init(); | 130 | early_nvram_init(); |
@@ -143,6 +143,6 @@ int nvram_getenv(char *name, char *val, size_t val_len) | |||
143 | return snprintf(val, val_len, "%s", value); | 143 | return snprintf(val, val_len, "%s", value); |
144 | } | 144 | } |
145 | } | 145 | } |
146 | return NVRAM_ERR_ENVNOTFOUND; | 146 | return -ENOENT; |
147 | } | 147 | } |
148 | EXPORT_SYMBOL(nvram_getenv); | 148 | EXPORT_SYMBOL(nvram_getenv); |
diff --git a/arch/mips/bcm47xx/sprom.c b/arch/mips/bcm47xx/sprom.c index 289cc0a38638..66b71c363300 100644 --- a/arch/mips/bcm47xx/sprom.c +++ b/arch/mips/bcm47xx/sprom.c | |||
@@ -51,7 +51,7 @@ static int get_nvram_var(const char *prefix, const char *postfix, | |||
51 | create_key(prefix, postfix, name, key, sizeof(key)); | 51 | create_key(prefix, postfix, name, key, sizeof(key)); |
52 | 52 | ||
53 | err = nvram_getenv(key, buf, len); | 53 | err = nvram_getenv(key, buf, len); |
54 | if (fallback && err == NVRAM_ERR_ENVNOTFOUND && prefix) { | 54 | if (fallback && err == -ENOENT && prefix) { |
55 | create_key(NULL, postfix, name, key, sizeof(key)); | 55 | create_key(NULL, postfix, name, key, sizeof(key)); |
56 | err = nvram_getenv(key, buf, len); | 56 | err = nvram_getenv(key, buf, len); |
57 | } | 57 | } |
diff --git a/arch/mips/include/asm/mach-bcm47xx/nvram.h b/arch/mips/include/asm/mach-bcm47xx/nvram.h index 69ef3efe06e7..550a7fc932c9 100644 --- a/arch/mips/include/asm/mach-bcm47xx/nvram.h +++ b/arch/mips/include/asm/mach-bcm47xx/nvram.h | |||
@@ -32,9 +32,6 @@ struct nvram_header { | |||
32 | #define NVRAM_MAX_VALUE_LEN 255 | 32 | #define NVRAM_MAX_VALUE_LEN 255 |
33 | #define NVRAM_MAX_PARAM_LEN 64 | 33 | #define NVRAM_MAX_PARAM_LEN 64 |
34 | 34 | ||
35 | #define NVRAM_ERR_INV_PARAM -8 | ||
36 | #define NVRAM_ERR_ENVNOTFOUND -9 | ||
37 | |||
38 | extern int nvram_getenv(char *name, char *val, size_t val_len); | 35 | extern int nvram_getenv(char *name, char *val, size_t val_len); |
39 | 36 | ||
40 | static inline void nvram_parse_macaddr(char *buf, u8 macaddr[6]) | 37 | static inline void nvram_parse_macaddr(char *buf, u8 macaddr[6]) |