blob: b3089b1f73d03df57a36b0627bd3440fd765a2ed [file] [log] [blame]
--- a/drivers/net/wireless/ti/wlcore/main.c
+++ b/drivers/net/wireless/ti/wlcore/main.c
@@ -6081,15 +6081,27 @@ static void wlcore_nvs_cb(const struct f
wl->platform_quirks = pdata->platform_quirks;
wl->if_ops = pdev_data->if_ops;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,32)
+ irqflags = IRQF_TRIGGER_RISING;
+ hardirq_fn = wlcore_hardirq;
+#else
if (wl->platform_quirks & WL12XX_PLATFORM_QUIRK_EDGE_IRQ) {
irqflags = IRQF_TRIGGER_RISING;
hardirq_fn = wlcore_hardirq;
} else {
irqflags = IRQF_TRIGGER_HIGH | IRQF_ONESHOT;
}
+#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+ ret = compat_request_threaded_irq(&wl->irq_compat, wl->irq,
+ hardirq_fn, wlcore_irq,
+ irqflags,
+ pdev->name, wl);
+#else
ret = request_threaded_irq(wl->irq, hardirq_fn, wlcore_irq,
irqflags, pdev->name, wl);
+#endif
if (ret < 0) {
wl1271_error("request_irq() failed: %d", ret);
goto out_free_nvs;
@@ -6135,7 +6147,11 @@ out_unreg:
wl1271_unregister_hw(wl);
out_irq:
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+ compat_free_threaded_irq(&wl->irq_compat);
+#else
free_irq(wl->irq, wl);
+#endif
out_free_nvs:
kfree(wl->nvs);
@@ -6181,7 +6197,12 @@ int wlcore_remove(struct platform_device
disable_irq_wake(wl->irq);
}
wl1271_unregister_hw(wl);
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)
+ compat_free_threaded_irq(&wl->irq_compat);
+ compat_destroy_threaded_irq(&wl->irq_compat);
+#else
free_irq(wl->irq, wl);
+#endif
wlcore_free_hw(wl);
return 0;