mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 08:46:46 +00:00
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: 9745079609
("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
This commit is contained in:
parent
b470cef1ff
commit
beb3fb4165
1 changed files with 6 additions and 6 deletions
|
@ -500,12 +500,6 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_free;
|
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) {
|
if (irq > 0) {
|
||||||
struct gpio_irq_chip *girq;
|
struct gpio_irq_chip *girq;
|
||||||
|
|
||||||
|
@ -528,6 +522,12 @@ static int stmpe_gpio_probe(struct platform_device *pdev)
|
||||||
girq->threaded = true;
|
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);
|
platform_set_drvdata(pdev, stmpe_gpio);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue