* [PATCH] MIPS: BCM47xx: nvram_getenv fix return value.
@ 2010-08-02 21:56 Hauke Mehrtens
2010-08-05 0:35 ` Ralf Baechle
0 siblings, 1 reply; 2+ messages in thread
From: Hauke Mehrtens @ 2010-08-02 21:56 UTC (permalink / raw)
To: ralf, linux-mips; +Cc: Hauke Mehrtens, Waldemar Brodkorb
nvram_getenv should behave like cfe_getenv. For now it is used 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.
The code using nvram_getenv expects it to behave like cfe_getenv does.
CC: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
arch/mips/bcm47xx/nvram.c | 4 ++--
arch/mips/include/asm/mach-bcm47xx/nvram.h | 3 +++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/arch/mips/bcm47xx/nvram.c b/arch/mips/bcm47xx/nvram.c
index 06e03b2..e5b6615 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);
diff --git a/arch/mips/include/asm/mach-bcm47xx/nvram.h b/arch/mips/include/asm/mach-bcm47xx/nvram.h
index 0d8cc14..c58ebd8 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 {
#define NVRAM_MAX_VALUE_LEN 255
#define NVRAM_MAX_PARAM_LEN 64
+#define NVRAM_ERR_INV_PARAM -8
+#define NVRAM_ERR_ENVNOTFOUND -9
+
extern int nvram_getenv(char *name, char *val, size_t val_len);
#endif
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] MIPS: BCM47xx: nvram_getenv fix return value.
2010-08-02 21:56 [PATCH] MIPS: BCM47xx: nvram_getenv fix return value Hauke Mehrtens
@ 2010-08-05 0:35 ` Ralf Baechle
0 siblings, 0 replies; 2+ messages in thread
From: Ralf Baechle @ 2010-08-05 0:35 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linux-mips, Waldemar Brodkorb
Thanks, applied.
Ralf
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-05 0:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-02 21:56 [PATCH] MIPS: BCM47xx: nvram_getenv fix return value Hauke Mehrtens
2010-08-05 0:35 ` Ralf Baechle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.