[at91] Allow module compilation for adc driver
[openwrt.git] / target / linux / brcm47xx / patches-2.6.36 / 030-b44-fix-workarround-for-wap54g10.patch
1 From 93f94103b9d239b15bba69f592bb6fb2ec5e363f Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sat, 27 Nov 2010 13:14:14 +0100
4 Subject: [PATCH 5/6] b44: fix workarround for wap54g10
5
6 The code for the b44_wap54g10_workaround was never included, because
7 the config option was wrong. The nvram_get function was never in
8 mainline kernel, only in external OpenWrt patches.
9
10 The code should be compiled in when CONFIG_BCM47XX is selected and not
11 when CONFIG_SSB_DRIVER_MIPS is selected, because nvram_getenv is only
12 available on bcm47xx platforms and now in the mainline kernel code.
13 Using an include is better than a second function declaration, to fix
14 this when the function signature changes.
15
16 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
17 ---
18 drivers/net/b44.c | 11 +++++------
19 1 files changed, 5 insertions(+), 6 deletions(-)
20
21 --- a/drivers/net/b44.c
22 +++ b/drivers/net/b44.c
23 @@ -381,11 +381,11 @@ static void b44_set_flow_ctrl(struct b44
24 __b44_set_flow_ctrl(bp, pause_enab);
25 }
26
27 -#ifdef SSB_DRIVER_MIPS
28 -extern char *nvram_get(char *name);
29 +#ifdef CONFIG_BCM47XX
30 +#include <asm/mach-bcm47xx/nvram.h>
31 static void b44_wap54g10_workaround(struct b44 *bp)
32 {
33 - const char *str;
34 + char buf[20];
35 u32 val;
36 int err;
37
38 @@ -394,10 +394,9 @@ static void b44_wap54g10_workaround(stru
39 * see https://dev.openwrt.org/ticket/146
40 * check and reset bit "isolate"
41 */
42 - str = nvram_get("boardnum");
43 - if (!str)
44 + if (nvram_getenv("boardnum", buf, sizeof(buf)) < 0)
45 return;
46 - if (simple_strtoul(str, NULL, 0) == 2) {
47 + if (simple_strtoul(buf, NULL, 0) == 2) {
48 err = __b44_readphy(bp, 0, MII_BMCR, &val);
49 if (err)
50 goto error;
This page took 0.044688 seconds and 5 git commands to generate.