diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-06-25 08:32:25 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-06-25 08:32:25 +0000 |
commit | 1d5d64e647517cdd5bc8d0bb8c408babfec51d79 (patch) | |
tree | 1db4163deba31f36d771177dfcfabb21cd93f2ac /package/broadcom-diag/src/gpio.h | |
parent | 52242b5f8e3dc36c54338c921d43e468e3cce71d (diff) |
fix failsafe on broadcom, send netlink events in diag when running linux 2.6
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@7722 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/broadcom-diag/src/gpio.h')
-rw-r--r-- | package/broadcom-diag/src/gpio.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/package/broadcom-diag/src/gpio.h b/package/broadcom-diag/src/gpio.h index 16f6ca41cd..6d83039ee7 100644 --- a/package/broadcom-diag/src/gpio.h +++ b/package/broadcom-diag/src/gpio.h @@ -53,7 +53,7 @@ static inline u32 gpio_intpolarity(u32 mask, u32 value) gpio_op(polarity, mask, value); } -static void gpio_set_irqenable(int enabled, irqreturn_t (*handler)(int, void *, struct pt_regs *)) +static void gpio_set_irqenable(int enabled, irqreturn_t (*handler)(int, void *)) { int irq; @@ -63,10 +63,12 @@ static void gpio_set_irqenable(int enabled, irqreturn_t (*handler)(int, void *, irq = ssb_mips_irq(ssb.extif.dev) + 2; else return; - if (enabled) - request_irq(irq, handler, SA_SHIRQ | SA_SAMPLE_RANDOM, "gpio", handler); - else + if (enabled) { + if (request_irq(irq, handler, IRQF_SHARED | IRQF_SAMPLE_RANDOM, "gpio", handler)) + return; + } else { free_irq(irq, handler); + } if (ssb.chipco.dev) ssb_write32_masked(ssb.chipco.dev, SSB_CHIPCO_IRQMASK, SSB_CHIPCO_IRQ_GPIO, (enabled ? SSB_CHIPCO_IRQ_GPIO : 0)); |