Skip to content

Commit beb3fb4

Browse files
committed
gpio: stmpe: Move chip registration
Make sure to register the GPIO chip after requesting the interrupt and setting up the IRQ members of the irqchip. Fixes: 9745079 ("gpio: stmpe: Use irqchip template") Reported-by: Serge Semin <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Cc: Patrice Chotard <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b470cef commit beb3fb4

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/gpio/gpio-stmpe.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -500,12 +500,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
500500
if (ret)
501501
goto out_free;
502502

503-
ret = gpiochip_add_data(&stmpe_gpio->chip, stmpe_gpio);
504-
if (ret) {
505-
dev_err(&pdev->dev, "unable to add gpiochip: %d\n", ret);
506-
goto out_disable;
507-
}
508-
509503
if (irq > 0) {
510504
struct gpio_irq_chip *girq;
511505

@@ -528,6 +522,12 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
528522
girq->threaded = true;
529523
}
530524

525+
ret = gpiochip_add_data(&stmpe_gpio->chip, stmpe_gpio);
526+
if (ret) {
527+
dev_err(&pdev->dev, "unable to add gpiochip: %d\n", ret);
528+
goto out_disable;
529+
}
530+
531531
platform_set_drvdata(pdev, stmpe_gpio);
532532

533533
return 0;

0 commit comments

Comments
 (0)