diff options
author | Hauke Mehrtens <hauke@hauke-m.de> | 2012-11-18 21:27:00 +0000 |
---|---|---|
committer | Hauke Mehrtens <hauke@hauke-m.de> | 2012-11-18 21:27:00 +0000 |
commit | 86cc79ac985ffd954d26c88d144b82063a714636 (patch) | |
tree | d750f1c9a309e6ff92cdd4233d6b9749ce2bc996 /target/linux/brcm47xx/patches-3.6/400-arch-bcm47xx.patch | |
parent | d648dad7fa7708a1879579ac6a6e87825eccd028 (diff) | |
download | upstream-86cc79ac985ffd954d26c88d144b82063a714636.tar.gz upstream-86cc79ac985ffd954d26c88d144b82063a714636.tar.bz2 upstream-86cc79ac985ffd954d26c88d144b82063a714636.zip |
brcm47xx: add support for kernel 3.6
This is based on the patch by Peter Wagner.
SVN-Revision: 34252
Diffstat (limited to 'target/linux/brcm47xx/patches-3.6/400-arch-bcm47xx.patch')
-rw-r--r-- | target/linux/brcm47xx/patches-3.6/400-arch-bcm47xx.patch | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/target/linux/brcm47xx/patches-3.6/400-arch-bcm47xx.patch b/target/linux/brcm47xx/patches-3.6/400-arch-bcm47xx.patch new file mode 100644 index 0000000000..bdd2c040dc --- /dev/null +++ b/target/linux/brcm47xx/patches-3.6/400-arch-bcm47xx.patch @@ -0,0 +1,33 @@ +--- a/arch/mips/bcm47xx/nvram.c ++++ b/arch/mips/bcm47xx/nvram.c +@@ -183,3 +183,30 @@ int nvram_getenv(char *name, char *val, + return NVRAM_ERR_ENVNOTFOUND; + } + EXPORT_SYMBOL(nvram_getenv); ++ ++char *nvram_get(const char *name) ++{ ++ char *var, *value, *end, *eq; ++ ++ if (!name) ++ return NULL; ++ ++ if (!nvram_buf[0]) ++ early_nvram_init(); ++ ++ /* Look for name=value and return value */ ++ var = &nvram_buf[sizeof(struct nvram_header)]; ++ end = nvram_buf + sizeof(nvram_buf) - 2; ++ end[0] = end[1] = '\0'; ++ for (; *var; var = value + strlen(value) + 1) { ++ eq = strchr(var, '='); ++ if (!eq) ++ break; ++ value = eq + 1; ++ if ((eq - var) == strlen(name) && strncmp(var, name, (eq - var)) == 0) ++ return value; ++ } ++ ++ return NULL; ++} ++EXPORT_SYMBOL(nvram_get); |