diff mbox

b44: fix workarround for wap54g10

Message ID 1290876463-4372-1-git-send-email-hauke@hauke-m.de
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Hauke Mehrtens Nov. 27, 2010, 4:47 p.m. UTC
The code for the b44_wap54g10_workaround was never included, because
the config option was wrong. The nvram_get function was never in
mainline kernel, only in external OpenWrt patches.

The code should be compiled in when CONFIG_BCM47XX is selected and not
when CONFIG_SSB_DRIVER_MIPS is selected, because nvram_getenv is only
available on bcm47xx platforms and now in the mainline kernel code.
Using an include is better than a second function declaration, to fix
this when the function signature changes.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/net/b44.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

Comments

David Miller Dec. 1, 2010, 7:12 p.m. UTC | #1
From: Hauke Mehrtens <hauke@hauke-m.de>
Date: Sat, 27 Nov 2010 17:47:43 +0100

> The code for the b44_wap54g10_workaround was never included, because
> the config option was wrong. The nvram_get function was never in
> mainline kernel, only in external OpenWrt patches.
> 
> The code should be compiled in when CONFIG_BCM47XX is selected and not
> when CONFIG_SSB_DRIVER_MIPS is selected, because nvram_getenv is only
> available on bcm47xx platforms and now in the mainline kernel code.
> Using an include is better than a second function declaration, to fix
> this when the function signature changes.
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>

Applied, thank you.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index c6e8631..2e2b762 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -381,11 +381,11 @@  static void b44_set_flow_ctrl(struct b44 *bp, u32 local, u32 remote)
 	__b44_set_flow_ctrl(bp, pause_enab);
 }
 
-#ifdef SSB_DRIVER_MIPS
-extern char *nvram_get(char *name);
+#ifdef CONFIG_BCM47XX
+#include <asm/mach-bcm47xx/nvram.h>
 static void b44_wap54g10_workaround(struct b44 *bp)
 {
-	const char *str;
+	char buf[20];
 	u32 val;
 	int err;
 
@@ -394,10 +394,9 @@  static void b44_wap54g10_workaround(struct b44 *bp)
 	 * see https://dev.openwrt.org/ticket/146
 	 * check and reset bit "isolate"
 	 */
-	str = nvram_get("boardnum");
-	if (!str)
+	if (nvram_getenv("boardnum", buf, sizeof(buf)) < 0)
 		return;
-	if (simple_strtoul(str, NULL, 0) == 2) {
+	if (simple_strtoul(buf, NULL, 0) == 2) {
 		err = __b44_readphy(bp, 0, MII_BMCR, &val);
 		if (err)
 			goto error;