pinctrl: sx150x: use new nested IRQ infrastructure
authorLinus Walleij <linus.walleij@linaro.org>
Fri, 25 Nov 2016 14:16:11 +0000 (15:16 +0100)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 7 Dec 2016 15:02:55 +0000 (16:02 +0100)
Use the new gpiochip_irqchip_add_nested() and
gpiochip_set_nested_irqchip() calls to properly created
a nested irqchip and mark all child irqs properly with
their parent IRQ.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-sx150x.c

index bdb7ea3..29fb740 100644 (file)
@@ -1221,9 +1221,9 @@ static int sx150x_probe(struct i2c_client *client,
                 * plus it will be instantly noticeable if it is ever
                 * called (should not happen)
                 */
-               ret = gpiochip_irqchip_add(&pctl->gpio,
-                                          &pctl->irq_chip, 0,
-                                          handle_bad_irq, IRQ_TYPE_NONE);
+               ret = gpiochip_irqchip_add_nested(&pctl->gpio,
+                                       &pctl->irq_chip, 0,
+                                       handle_bad_irq, IRQ_TYPE_NONE);
                if (ret) {
                        dev_err(dev, "could not connect irqchip to gpiochip\n");
                        return ret;
@@ -1236,6 +1236,10 @@ static int sx150x_probe(struct i2c_client *client,
                                                pctl->irq_chip.name, pctl);
                if (ret < 0)
                        return ret;
+
+               gpiochip_set_nested_irqchip(&pctl->gpio,
+                                           &pctl->irq_chip,
+                                           client->irq);
        }
 
        /* Pinctrl_desc */