Skip to content

Commit

Permalink
gpio: wcove: Request IRQ after all initialisation done
Browse files Browse the repository at this point in the history
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 <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Linus Walleij <[email protected]>
  • Loading branch information
andy-shev authored and linusw committed Aug 3, 2020
1 parent a1cdaa6 commit 22cc422
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions drivers/gpio/gpio-wcove.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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);
Expand Down

0 comments on commit 22cc422

Please sign in to comment.