aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2010-08-02 17:56:22 -0400
committerRalf Baechle <ralf@linux-mips.org>2010-08-05 08:26:31 -0400
commit47a348614492987ef307aad299c09163344e4eaf (patch)
treef7aa65b0c9fde6cba390a1a38acdeaba2f91556e
parent2b5987abaf2dd6c3934e0376b7d9f64411cdcf03 (diff)
MIPS: BCM47xx: Fix nvram_getenv return value.
Nvram_getenv should behave like cfe_getenv. cfe_getenv returns 0 on success and -9 if the value was not found. If the input was wrong -8 will be returned by cfe_getenv. Change nvram_getenv to do the same. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Cc: Waldemar Brodkorb <wbx@openadk.org> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/1520/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/bcm47xx/nvram.c4
-rw-r--r--arch/mips/include/asm/mach-bcm47xx/nvram.h3
2 files changed, 5 insertions, 2 deletions
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
index 06e03b222f6d..e5b6615731e5 100644
--- a/arch/mips/bcm47xx/nvram.c
+++ b/arch/mips/bcm47xx/nvram.c
@@ -69,7 +69,7 @@ int nvram_getenv(char *name, char *val, size_t val_len)
69 char *var, *value, *end, *eq; 69 char *var, *value, *end, *eq;
70 70
71 if (!name) 71 if (!name)
72 return 1; 72 return NVRAM_ERR_INV_PARAM;
73 73
74 if (!nvram_buf[0]) 74 if (!nvram_buf[0])
75 early_nvram_init(); 75 early_nvram_init();
@@ -89,6 +89,6 @@ int nvram_getenv(char *name, char *val, size_t val_len)
89 return 0; 89 return 0;
90 } 90 }
91 } 91 }
92 return 1; 92 return NVRAM_ERR_ENVNOTFOUND;
93} 93}
94EXPORT_SYMBOL(nvram_getenv); 94EXPORT_SYMBOL(nvram_getenv);
diff --git a/arch/mips/include/asm/mach-bcm47xx/nvram.h b/arch/mips/include/asm/mach-bcm47xx/nvram.h
index 0d8cc146f7a4..c58ebd8bc155 100644
--- a/arch/mips/include/asm/mach-bcm47xx/nvram.h
+++ b/arch/mips/include/asm/mach-bcm47xx/nvram.h
@@ -31,6 +31,9 @@ struct nvram_header {
31#define NVRAM_MAX_VALUE_LEN 255 31#define NVRAM_MAX_VALUE_LEN 255
32#define NVRAM_MAX_PARAM_LEN 64 32#define NVRAM_MAX_PARAM_LEN 64
33 33
34#define NVRAM_ERR_INV_PARAM -8
35#define NVRAM_ERR_ENVNOTFOUND -9
36
34extern int nvram_getenv(char *name, char *val, size_t val_len); 37extern int nvram_getenv(char *name, char *val, size_t val_len);
35 38
36#endif 39#endif