brcm47xx: detect Linksys E1200 V2
[oweals/openwrt.git] / target / linux / brcm47xx / patches-3.10 / 711-bgmac_fix_parsing_of_et_swtype.patch
1 --- a/drivers/net/ethernet/broadcom/bgmac.c
2 +++ b/drivers/net/ethernet/broadcom/bgmac.c
3 @@ -909,9 +909,9 @@ static void bgmac_chip_reset(struct bgma
4                 u8 et_swtype = 0;
5                 u8 sw_type = BGMAC_CHIPCTL_1_SW_TYPE_EPHY |
6                              BGMAC_CHIPCTL_1_IF_TYPE_MII;
7 -               char buf[2];
8 +               char buf[4];
9  
10 -               if (bcm47xx_nvram_getenv("et_swtype", buf, 1) > 0) {
11 +               if (bcm47xx_nvram_getenv("et_swtype", buf, sizeof(buf)) > 0) {
12                         if (kstrtou8(buf, 0, &et_swtype))
13                                 bgmac_err(bgmac, "Failed to parse et_swtype (%s)\n",
14                                           buf);