broadcom-diag: show error message in case something goes wrong with gpio irq
authorHauke Mehrtens <hauke@hauke-m.de>
Sat, 3 Aug 2013 17:12:07 +0000 (17:12 +0000)
committerHauke Mehrtens <hauke@hauke-m.de>
Sat, 3 Aug 2013 17:12:07 +0000 (17:12 +0000)
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
SVN-Revision: 37668

package/kernel/broadcom-diag/src/diag.c

index c2a0d0919408be3cdfdbdfb57c52a9fa05c465a7..1fad586c521209a1d9c1f98ed2c92512d7d335d6 100644 (file)
@@ -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);
        }