brcm47xx: fix error in board detection when nvram is not available.
SVN-Revision: 36234
This commit is contained in:
parent
d45ef216e6
commit
204bde8d98
2 changed files with 8 additions and 4 deletions
|
@ -8,7 +8,7 @@
|
||||||
obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
|
obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/arch/mips/bcm47xx/board.c
|
+++ b/arch/mips/bcm47xx/board.c
|
||||||
@@ -0,0 +1,220 @@
|
@@ -0,0 +1,222 @@
|
||||||
+#include <linux/export.h>
|
+#include <linux/export.h>
|
||||||
+#include <linux/string.h>
|
+#include <linux/string.h>
|
||||||
+#include <bcm47xx_board.h>
|
+#include <bcm47xx_board.h>
|
||||||
|
@ -209,8 +209,10 @@
|
||||||
+ if (bcm47xx_board != NULL)
|
+ if (bcm47xx_board != NULL)
|
||||||
+ return;
|
+ return;
|
||||||
+ /* check if the nvram is available */
|
+ /* check if the nvram is available */
|
||||||
+ if (bcm47xx_nvram_getenv("boardtype", buf, sizeof(buf)) == -ENXIO)
|
+ if (bcm47xx_nvram_getenv("boardtype", buf, sizeof(buf)) == -ENXIO) {
|
||||||
|
+ bcm47xx_board = bcm47xx_board_unknown;
|
||||||
+ return;
|
+ return;
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
+ bcm47xx_board = bcm47xx_board_get_nvram();
|
+ bcm47xx_board = bcm47xx_board_get_nvram();
|
||||||
+ pr_info("Found board: \"%s\"\n", bcm47xx_board->name);
|
+ pr_info("Found board: \"%s\"\n", bcm47xx_board->name);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
|
obj-$(CONFIG_BCM47XX_SSB) += wgt634u.o
|
||||||
--- /dev/null
|
--- /dev/null
|
||||||
+++ b/arch/mips/bcm47xx/board.c
|
+++ b/arch/mips/bcm47xx/board.c
|
||||||
@@ -0,0 +1,220 @@
|
@@ -0,0 +1,222 @@
|
||||||
+#include <linux/export.h>
|
+#include <linux/export.h>
|
||||||
+#include <linux/string.h>
|
+#include <linux/string.h>
|
||||||
+#include <bcm47xx_board.h>
|
+#include <bcm47xx_board.h>
|
||||||
|
@ -209,8 +209,10 @@
|
||||||
+ if (bcm47xx_board != NULL)
|
+ if (bcm47xx_board != NULL)
|
||||||
+ return;
|
+ return;
|
||||||
+ /* check if the nvram is available */
|
+ /* check if the nvram is available */
|
||||||
+ if (bcm47xx_nvram_getenv("boardtype", buf, sizeof(buf)) == -ENXIO)
|
+ if (bcm47xx_nvram_getenv("boardtype", buf, sizeof(buf)) == -ENXIO) {
|
||||||
|
+ bcm47xx_board = bcm47xx_board_unknown;
|
||||||
+ return;
|
+ return;
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
+ bcm47xx_board = bcm47xx_board_get_nvram();
|
+ bcm47xx_board = bcm47xx_board_get_nvram();
|
||||||
+ pr_info("Found board: \"%s\"\n", bcm47xx_board->name);
|
+ pr_info("Found board: \"%s\"\n", bcm47xx_board->name);
|
||||||
|
|
Loading…
Reference in a new issue