MIPS: BCM47XX: return number of written bytes in nvram_getenv
authorHauke Mehrtens <hauke@hauke-m.de>
Mon, 27 Feb 2012 23:56:11 +0000 (00:56 +0100)
committerJohn W. Linville <linville@tuxdriver.com>
Mon, 5 Mar 2012 20:20:50 +0000 (15:20 -0500)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
arch/mips/bcm47xx/nvram.c

index a84e3bb7387f685bc7025e689e01e57cfa97bd21..d43ceff5be4782b7024ae0f04ad73f278d4d7486 100644 (file)
@@ -107,8 +107,7 @@ int nvram_getenv(char *name, char *val, size_t val_len)
                value = eq + 1;
                if ((eq - var) == strlen(name) &&
                        strncmp(var, name, (eq - var)) == 0) {
-                       snprintf(val, val_len, "%s", value);
-                       return 0;
+                       return snprintf(val, val_len, "%s", value);
                }
        }
        return NVRAM_ERR_ENVNOTFOUND;