1 From ff7295cc37b1e4b31aed9f071374f43aa128329b Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Fri, 30 Jul 2010 17:45:20 +0200
4 Subject: [PATCH 5/6] MIPS: BCM47xx: nvram_getenv fix return value.
6 nvram_getenv should behave like cfe_getenv. For now it is used like
7 cfe_getenv. cfe_getenv returns 0 on success and -1 in case of an error.
8 Change nvram_getenv to do the same.
10 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
12 arch/mips/bcm47xx/nvram.c | 4 ++--
13 arch/mips/include/asm/mach-bcm47xx/nvram.h | 3 +++
14 2 files changed, 5 insertions(+), 2 deletions(-)
16 --- a/arch/mips/bcm47xx/nvram.c
17 +++ b/arch/mips/bcm47xx/nvram.c
18 @@ -69,7 +69,7 @@ int nvram_getenv(char *name, char *val,
19 char *var, *value, *end, *eq;
23 + return NVRAM_ERR_INV_PARAM;
27 @@ -89,6 +89,6 @@ int nvram_getenv(char *name, char *val,
32 + return NVRAM_ERR_ENVNOTFOUND;
34 EXPORT_SYMBOL(nvram_getenv);
35 --- a/arch/mips/include/asm/mach-bcm47xx/nvram.h
36 +++ b/arch/mips/include/asm/mach-bcm47xx/nvram.h
37 @@ -31,6 +31,10 @@ struct nvram_header {
38 #define NVRAM_MAX_VALUE_LEN 255
39 #define NVRAM_MAX_PARAM_LEN 64
41 +// TODO: replace by old values. This chaueses that the system will not try to look into the cfe.
42 +#define NVRAM_ERR_INV_PARAM 1 // -8
43 +#define NVRAM_ERR_ENVNOTFOUND 1 // -9
45 extern int nvram_getenv(char *name, char *val, size_t val_len);