gpiolib: allow nested threaded irqs for poll(2)
authorDaniel Gl?ckner <dg@emlix.com>
Wed, 11 Aug 2010 01:02:26 +0000 (18:02 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Aug 2010 15:59:09 +0000 (08:59 -0700)
The pca953x driver requires the use of threaded irqs as its irq
demultiplexer can sleep.  Our irq handler can be called from any context,
so use request_any_context_irq to allow threaded irqs as well.

Signed-off-by: Daniel Gl?ckner <dg@emlix.com>
Reported-by: Ian Jeffray <ian@jeffray.co.uk>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/gpio/gpiolib.c

index 8a29404985f17fda266c03c42c02671c496f3d3f..21da9c19a0cba82e1a8aba6aa52056953efb4f82 100644 (file)
@@ -386,9 +386,9 @@ static int gpio_setup_irq(struct gpio_desc *desc, struct device *dev,
                }
        }
 
-       ret = request_irq(irq, gpio_sysfs_irq, irq_flags,
+       ret = request_any_context_irq(irq, gpio_sysfs_irq, irq_flags,
                                "gpiolib", value_sd);
-       if (ret)
+       if (ret < 0)
                goto free_id;
 
        desc->flags |= gpio_flags;