compat-wireless: fix compile problem with IRQF_ONESHOT
authorHauke Mehrtens <hauke@hauke-m.de>
Tue, 26 Apr 2011 21:49:44 +0000 (23:49 +0200)
committerLuis R. Rodriguez <lrodriguez@atheros.com>
Tue, 26 Apr 2011 21:56:15 +0000 (14:56 -0700)
IRQF_ONESHOT was introduced in kernel 2.6.32 and wl12xx uses it.
This patch reverts back to the old behavior when older kernels are used.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
patches/09-threaded-irq.patch

index 82c817f8436e6df5bf6934527a8d7bb8376f36f3..0e25e21c925957e176176d1986916032181c4a6a 100644 (file)
@@ -63,22 +63,33 @@ thread in process context as well.
  /* Data structure for the WLAN parts (802.11 cores) of the b43 chip. */
 --- a/drivers/net/wireless/wl12xx/spi.c
 +++ b/drivers/net/wireless/wl12xx/spi.c
-@@ -417,9 +417,20 @@ static int __devinit wl1271_probe(struct
+@@ -405,10 +405,14 @@ static int __devinit wl1271_probe(struct
+       wl->tcxo_clock = pdata->board_tcxo_clock;
+       wl->platform_quirks = pdata->platform_quirks;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
++      irqflags = IRQF_TRIGGER_RISING;
++#else
+       if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ)
+               irqflags = IRQF_TRIGGER_RISING;
+       else
+               irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
++#endif
+       wl->irq = spi->irq;
+       if (wl->irq < 0) {
+@@ -417,9 +421,16 @@ static int __devinit wl1271_probe(struct
                goto out_free;
        }
  
 +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
 +      ret = compat_request_threaded_irq(&wl->irq_compat, wl->irq,
 +                                        wl1271_hardirq, wl1271_irq,
-+                                        IRQF_TRIGGER_RISING,
++                                        irqflags,
 +                                        DRIVER_NAME, wl);
 +#else
        ret = request_threaded_irq(wl->irq, wl1271_hardirq, wl1271_irq,
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
-+                                  IRQF_TRIGGER_RISING,
-+#else
                                   irqflags,
-+#endif
                                   DRIVER_NAME, wl);
 +#endif
        if (ret < 0) {