summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2020-07-28 09:27:06 +0200
committerLinus Walleij <linus.walleij@linaro.org>2020-08-04 01:07:23 +0200
commitbeb3fb41659a3cff2121f126a83fd7167b601a63 (patch)
treedb2512c06aaa13a3fac5f7d9fc49e21aeedfa77d /drivers/gpio
parentb470cef1ffac1acc327fe3343a2ce3ef3a526a21 (diff)
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: 9745079609df ("gpio: stmpe: Use irqchip template") Reported-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Cc: Patrice Chotard <patrice.chotard@st.com> Link: https://lore.kernel.org/r/20200728072706.348725-1-linus.walleij@linaro.org
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/gpio-stmpe.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpio/gpio-stmpe.c b/drivers/gpio/gpio-stmpe.c
index 395ee51445ea..6c48809d0505 100644
--- a/drivers/gpio/gpio-stmpe.c
+++ b/drivers/gpio/gpio-stmpe.c
@@ -500,12 +500,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
if (ret)
goto out_free;
- ret = gpiochip_add_data(&stmpe_gpio->chip, stmpe_gpio);
- if (ret) {
- dev_err(&pdev->dev, "unable to add gpiochip: %d\n", ret);
- goto out_disable;
- }
-
if (irq > 0) {
struct gpio_irq_chip *girq;
@@ -528,6 +522,12 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
girq->threaded = true;
}
+ ret = gpiochip_add_data(&stmpe_gpio->chip, stmpe_gpio);
+ if (ret) {
+ dev_err(&pdev->dev, "unable to add gpiochip: %d\n", ret);
+ goto out_disable;
+ }
+
platform_set_drvdata(pdev, stmpe_gpio);
return 0;