diff options
author | Felix Fietkau <nbd@openwrt.org> | 2007-06-25 08:32:25 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2007-06-25 08:32:25 +0000 |
commit | 8c41e51e92fda935eb907b9263ae44a30f9977bc (patch) | |
tree | 4e365ae77cdc155df20d51f6b0b97fff828b3756 /package/broadcom-diag/src/gpio.h | |
parent | a99b79e9ad865990e0a6c438cfbb8adc88ccf6a0 (diff) | |
download | mtk-20170518-8c41e51e92fda935eb907b9263ae44a30f9977bc.zip mtk-20170518-8c41e51e92fda935eb907b9263ae44a30f9977bc.tar.gz mtk-20170518-8c41e51e92fda935eb907b9263ae44a30f9977bc.tar.bz2 |
fix failsafe on broadcom, send netlink events in diag when running linux 2.6
SVN-Revision: 7722
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 16f6ca4..6d83039 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)); |