OSDN Git Service

greybus: gpio: use irq-domain lookups
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 26 May 2015 13:29:22 +0000 (15:29 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Tue, 26 May 2015 22:25:17 +0000 (15:25 -0700)
Use irq_find_mapping directly rather than go through the legacy gpio
interface.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/gpio.c

index 526dd7e..15cc0ea 100644 (file)
@@ -303,9 +303,9 @@ static int gb_gpio_request_recv(u8 type, struct gb_operation *op)
                return -EINVAL;
        }
 
-       irq = gpio_to_irq(ggc->chip.base + event->which);
-       if (irq < 0) {
-               dev_err(ggc->chip.dev, "failed to map irq\n");
+       irq = irq_find_mapping(ggc->irqdomain, event->which);
+       if (!irq) {
+               dev_err(ggc->chip.dev, "failed to find IRQ\n");
                return -EINVAL;
        }
        desc = irq_to_desc(irq);