diff options
author | Peter Denison <openwrt@marshadder.org> | 2008-05-20 22:33:45 +0000 |
---|---|---|
committer | Peter Denison <openwrt@marshadder.org> | 2008-05-20 22:33:45 +0000 |
commit | a824434922bba71f64e5b93286afc1de1b542fc7 (patch) | |
tree | cb1fdc0d517cf45bfec7bc69c1565a20438266bd | |
parent | df83a6c4c8bb11e1b63a2cd12fbe4f482999778c (diff) | |
download | upstream-a824434922bba71f64e5b93286afc1de1b542fc7.tar.gz upstream-a824434922bba71f64e5b93286afc1de1b542fc7.tar.bz2 upstream-a824434922bba71f64e5b93286afc1de1b542fc7.zip |
[bcm47xx] Stopgap compilation fixes for diag and switch under 2.6.25
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@11231 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | package/broadcom-diag/src/diag.c | 8 | ||||
-rw-r--r-- | package/broadcom-diag/src/gpio.h | 9 | ||||
-rw-r--r-- | package/switch/src/gpio-bcm947xx.h | 4 |
3 files changed, 17 insertions, 4 deletions
diff --git a/package/broadcom-diag/src/diag.c b/package/broadcom-diag/src/diag.c index e1655d0b74..a1ee842f4f 100644 --- a/package/broadcom-diag/src/diag.c +++ b/package/broadcom-diag/src/diag.c @@ -682,7 +682,7 @@ static struct platform_t __init *platform_detect(void) /* Look for a model identifier */ /* Based on "model_name" */ - if (buf = nvram_get("model_name")) { + if ((buf = nvram_get("model_name"))) { if (!strcmp(buf, "DIR-130")) return &platforms[DIR130]; if (!strcmp(buf, "DIR-330")) @@ -690,13 +690,13 @@ static struct platform_t __init *platform_detect(void) } /* Based on "model_no" */ - if (buf = nvram_get("model_no")) { + if ((buf = nvram_get("model_no"))) { if (startswith(buf,"WL700")) /* WL700* */ return &platforms[WL700GE]; } /* Based on "hardware_version" */ - if (buf = nvram_get("hardware_version")) { + if ((buf = nvram_get("hardware_version"))) { if (startswith(buf,"WL500GPV2-")) /* WL500GPV2-* */ return &platforms[WL500GPV2]; if (startswith(buf,"WL520GC-")) /* WL520GU-* */ @@ -706,7 +706,7 @@ static struct platform_t __init *platform_detect(void) } /* Based on "ModelId" */ - if (buf = nvram_get("ModelId")) { + if ((buf = nvram_get("ModelId"))) { if (!strcmp(buf, "WR850GP")) return &platforms[WR850GP]; if (!strcmp(buf,"WX-5565")) diff --git a/package/broadcom-diag/src/gpio.h b/package/broadcom-diag/src/gpio.h index 2284e9801e..6b1b2ada4a 100644 --- a/package/broadcom-diag/src/gpio.h +++ b/package/broadcom-diag/src/gpio.h @@ -5,6 +5,10 @@ #ifndef BCMDRIVER #include <linux/ssb/ssb_embedded.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) +#include <linux/gpio.h> +#define ssb ssb_bcm47xx +#endif extern struct ssb_bus ssb; @@ -51,11 +55,16 @@ static void gpio_set_irqenable(int enabled, irqreturn_t (*handler)(int, void *)) { int irq; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) + irq = gpio_to_irq(0); + if (irq == -EINVAL) return; +#else if (ssb.chipco.dev) irq = ssb_mips_irq(ssb.chipco.dev) + 2; else if (ssb.extif.dev) irq = ssb_mips_irq(ssb.extif.dev) + 2; else return; +#endif if (enabled) { if (request_irq(irq, handler, IRQF_SHARED | IRQF_SAMPLE_RANDOM, "gpio", handler)) diff --git a/package/switch/src/gpio-bcm947xx.h b/package/switch/src/gpio-bcm947xx.h index 9417bce2a1..9135f916a7 100644 --- a/package/switch/src/gpio-bcm947xx.h +++ b/package/switch/src/gpio-bcm947xx.h @@ -5,6 +5,10 @@ #ifndef BCMDRIVER #include <linux/ssb/ssb_embedded.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25) +#define ssb ssb_bcm47xx +#endif + extern struct ssb_bus ssb; |