From 47a348614492987ef307aad299c09163344e4eaf Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Mon, 2 Aug 2010 23:56:22 +0200 Subject: 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 Cc: Waldemar Brodkorb Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/1520/ Signed-off-by: Ralf Baechle --- arch/mips/bcm47xx/nvram.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/mips/bcm47xx') diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c index 06e03b222f6..e5b6615731e 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) char *var, *value, *end, *eq; if (!name) - return 1; + return NVRAM_ERR_INV_PARAM; if (!nvram_buf[0]) early_nvram_init(); @@ -89,6 +89,6 @@ int nvram_getenv(char *name, char *val, size_t val_len) return 0; } } - return 1; + return NVRAM_ERR_ENVNOTFOUND; } EXPORT_SYMBOL(nvram_getenv); -- cgit v1.2.3-18-g5258