From: Hauke Mehrtens Date: Sat, 3 Aug 2013 17:12:07 +0000 (+0000) Subject: broadcom-diag: show error message in case something goes wrong with gpio irq X-Git-Tag: reboot~9584 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=7dea39fda2e974e7d5d40559325018a76adb1283;p=openwrt%2Fstaging%2Fpepe2k.git broadcom-diag: show error message in case something goes wrong with gpio irq Signed-off-by: Hauke Mehrtens SVN-Revision: 37668 --- diff --git a/package/kernel/broadcom-diag/src/diag.c b/package/kernel/broadcom-diag/src/diag.c index c2a0d09194..1fad586c52 100644 --- a/package/kernel/broadcom-diag/src/diag.c +++ b/package/kernel/broadcom-diag/src/diag.c @@ -1424,13 +1424,20 @@ static inline void ssb_maskset32(struct ssb_device *dev, static void gpio_set_irqenable(int enabled, irqreturn_t (*handler)(int, void *)) { int irq; + int err; irq = gpio_to_irq(0); - if (irq == -EINVAL) return; + if (irq < 0) { + pr_err("no irq for gpio available\n"); + return; + } if (enabled) { - if (request_irq(irq, handler, IRQF_SHARED, "gpio", handler)) + err = request_irq(irq, handler, IRQF_SHARED, "gpio", handler); + if (err) { + pr_err("can not reqeust irq\n"); return; + } } else { free_irq(irq, handler); }