gpio: wcove: Request IRQ after all initialisation done
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Tue, 28 Jul 2020 12:55:04 +0000 (15:55 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Mon, 3 Aug 2020 23:25:02 +0000 (01:25 +0200)
There is logically better to request IRQ when we initialise all structures.
Align the driver with the rest on the same matter.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20200728125504.27786-3-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-wcove.c

index 1356450..b5fbba5 100644 (file)
@@ -449,13 +449,6 @@ static int wcove_gpio_probe(struct platform_device *pdev)
                return virq;
        }
 
-       ret = devm_request_threaded_irq(dev, virq, NULL,
-               wcove_gpio_irq_handler, IRQF_ONESHOT, pdev->name, wg);
-       if (ret) {
-               dev_err(dev, "Failed to request irq %d\n", virq);
-               return ret;
-       }
-
        girq = &wg->chip.irq;
        girq->chip = &wcove_irqchip;
        /* This will let us handle the parent IRQ in the driver */
@@ -466,6 +459,13 @@ static int wcove_gpio_probe(struct platform_device *pdev)
        girq->handler = handle_simple_irq;
        girq->threaded = true;
 
+       ret = devm_request_threaded_irq(dev, virq, NULL, wcove_gpio_irq_handler,
+                                       IRQF_ONESHOT, pdev->name, wg);
+       if (ret) {
+               dev_err(dev, "Failed to request irq %d\n", virq);
+               return ret;
+       }
+
        ret = devm_gpiochip_add_data(dev, &wg->chip, wg);
        if (ret) {
                dev_err(dev, "Failed to add gpiochip: %d\n", ret);