brcm47xx: sprom for nvram parsing
[openwrt/svn-archive/archive.git] / target / linux / brcm47xx / patches-3.2 / 196-MIPS-BCM47XX-return-number-of-written-bytes-in-nvram.patch
1 From 3ac18c5072e097ffa719994ef3b5c64e744a5405 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sat, 18 Feb 2012 14:46:45 +0100
4 Subject: [PATCH 196/202] MIPS: BCM47XX: return number of written bytes in
5 nvram_getenv
6
7
8 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
9 ---
10 arch/mips/bcm47xx/nvram.c | 3 +--
11 1 files changed, 1 insertions(+), 2 deletions(-)
12
13 --- a/arch/mips/bcm47xx/nvram.c
14 +++ b/arch/mips/bcm47xx/nvram.c
15 @@ -192,8 +192,7 @@ int nvram_getenv(char *name, char *val,
16 value = eq + 1;
17 if ((eq - var) == strlen(name) &&
18 strncmp(var, name, (eq - var)) == 0) {
19 - snprintf(val, val_len, "%s", value);
20 - return 0;
21 + return snprintf(val, val_len, "%s", value);
22 }
23 }
24 return NVRAM_ERR_ENVNOTFOUND;