]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Staging: ipack/bridges/tpci200: Clean up interrupt handling.
authorJens Taprogge <jens.taprogge@taprogge.org>
Wed, 12 Sep 2012 12:55:34 +0000 (14:55 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Sep 2012 16:56:01 +0000 (09:56 -0700)
Previously the return value from tpci200_interrupt was not quite correct
if a slot had caused an interrupt but no handler was instellalled:
IRQ_NONE was returned.  However in this case we react to the interrupt
by disabling the IPack device interrupt.

Basically there are two cases the code now distinguishes:
 - The tpci200 has raised an interrupt.  We handle it and return
   IRQ_HANDLED.
 - Our device did not raise an interrupt. We return IRQ_NONE.

Signed-off-by: Jens Taprogge <jens.taprogge@taprogge.org>
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ipack/bridges/tpci200.c

index b1ddbe3ec33ad128761e1723105c48e00a1206f2..0cbaf3ab53cd2138de2014daea08b3230c4e546f 100644 (file)
@@ -116,7 +116,6 @@ static irqreturn_t tpci200_interrupt(int irq, void *dev_id)
        struct tpci200_board *tpci200 = (struct tpci200_board *) dev_id;
        int i;
        unsigned short status_reg;
-       irqreturn_t ret = IRQ_NONE;
        struct slot_irq *slot_irq;
 
        /* Read status register */
@@ -130,7 +129,7 @@ static irqreturn_t tpci200_interrupt(int irq, void *dev_id)
                                continue;
                        slot_irq = rcu_dereference(tpci200->slots[i].irq);
                        if (slot_irq) {
-                               ret = tpci200_slot_irq(slot_irq);
+                               tpci200_slot_irq(slot_irq);
                        } else {
                                dev_info(&tpci200->info->pdev->dev,
                                         "No registered ISR for slot [%d:%d]!. IRQ will be disabled.\n",
@@ -141,9 +140,11 @@ static irqreturn_t tpci200_interrupt(int irq, void *dev_id)
                        }
                }
                rcu_read_unlock();
-       }
 
-       return ret;
+               return IRQ_HANDLED;
+       } else {
+               return IRQ_NONE;
+       }
 }
 
 static int tpci200_register(struct tpci200_board *tpci200)