brcm47xx: add initial support for kernel 3.8
[openwrt/openwrt.git] / target / linux / brcm47xx / patches-3.8 / 201-MIPS-BCM47XX-trim-the-nvram-values-for-parsing.patch
1 --- a/arch/mips/bcm47xx/sprom.c
2 +++ b/arch/mips/bcm47xx/sprom.c
3 @@ -71,7 +71,7 @@ static void nvram_read_ ## type (const c
4 fallback); \
5 if (err < 0) \
6 return; \
7 - err = kstrto ## type (buf, 0, &var); \
8 + err = kstrto ## type(strim(buf), 0, &var); \
9 if (err) { \
10 pr_warn("can not parse nvram name %s%s%s with value %s got %i\n", \
11 prefix, name, postfix, buf, err); \
12 @@ -99,7 +99,7 @@ static void nvram_read_u32_2(const char
13 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback);
14 if (err < 0)
15 return;
16 - err = kstrtou32(buf, 0, &val);
17 + err = kstrtou32(strim(buf), 0, &val);
18 if (err) {
19 pr_warn("can not parse nvram name %s%s with value %s got %i\n",
20 prefix, name, buf, err);
21 @@ -120,7 +120,7 @@ static void nvram_read_leddc(const char
22 err = get_nvram_var(prefix, NULL, name, buf, sizeof(buf), fallback);
23 if (err < 0)
24 return;
25 - err = kstrtou32(buf, 0, &val);
26 + err = kstrtou32(strim(buf), 0, &val);
27 if (err) {
28 pr_warn("can not parse nvram name %s%s with value %s got %i\n",
29 prefix, name, buf, err);