25125af197caab25644bfefb06c1f8e0b39e6b24
[openwrt/staging/ynezz.git] /
1 From e0c3678ae640db049f738f30b5f23cde740799ac Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Wed, 1 Apr 2015 16:01:02 +0200
4 Subject: [PATCH] MIPS: BCM47XX: Fix detecting Microsoft MN-700 & Asus WL500G
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Since the day of adding this code it was broken. We were iterating over
10 a wrong array and checking for wrong NVRAM entry.
11
12 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
13 Cc: linux-mips@linux-mips.org
14 Cc: Hauke Mehrtens <hauke@hauke-m.de>
15 Patchwork: https://patchwork.linux-mips.org/patch/9654/
16 Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
17 ---
18 arch/mips/bcm47xx/board.c | 4 ++--
19 1 file changed, 2 insertions(+), 2 deletions(-)
20
21 diff --git a/arch/mips/bcm47xx/board.c b/arch/mips/bcm47xx/board.c
22 index b3ae068..3fd369d 100644
23 --- a/arch/mips/bcm47xx/board.c
24 +++ b/arch/mips/bcm47xx/board.c
25 @@ -247,8 +247,8 @@ static __init const struct bcm47xx_board_type *bcm47xx_board_get_nvram(void)
26 }
27
28 if (bcm47xx_nvram_getenv("hardware_version", buf1, sizeof(buf1)) >= 0 &&
29 - bcm47xx_nvram_getenv("boardtype", buf2, sizeof(buf2)) >= 0) {
30 - for (e2 = bcm47xx_board_list_boot_hw; e2->value1; e2++) {
31 + bcm47xx_nvram_getenv("boardnum", buf2, sizeof(buf2)) >= 0) {
32 + for (e2 = bcm47xx_board_list_hw_version_num; e2->value1; e2++) {
33 if (!strstarts(buf1, e2->value1) &&
34 !strcmp(buf2, e2->value2))
35 return &e2->board;
36 --
37 1.8.4.5
38