gpio/pca953x: Fix IRQ support.
authorDavid Jander <david@protonic.nl>
Tue, 14 Jun 2011 09:00:54 +0000 (11:00 +0200)
committerGrant Likely <grant.likely@secretlab.ca>
Thu, 16 Jun 2011 19:41:48 +0000 (13:41 -0600)
It seems that in the normal case, IRQ_NOREQUEST needs to be explicitly
cleared, otherwise claiming the interrupt fails.
In the case of sparse interrupts, the descriptor needs to be allocated
first.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/gpio/gpio-pca953x.c

index 4b8446e98de5c31f5cc8100796293e29299eeec7..5e4d3f23156af7bc64d9d9f37c11b2499d06513f 100644 (file)
@@ -517,8 +517,10 @@ out_failed:
 
 static void pca953x_irq_teardown(struct pca953x_chip *chip)
 {
-       if (chip->irq_base != -1)
+       if (chip->irq_base != -1) {
+               irq_free_descs(chip->irq_base, chip->gpio_chip.ngpio);
                free_irq(chip->client->irq, chip);
+       }
 }
 #else /* CONFIG_GPIO_PCA953X_IRQ */
 static int pca953x_irq_setup(struct pca953x_chip *chip,