summaryrefslogtreecommitdiff
path: root/drivers/gpio/gpio-ftgpio010.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2019-08-19 10:27:04 +0200
committerLinus Walleij <linus.walleij@linaro.org>2019-08-20 10:42:07 +0200
commita7e42142926f815c776f745d027f69a53415d99c (patch)
tree048e04ec5534f120360b4af2b961311ce07cf604 /drivers/gpio/gpio-ftgpio010.c
parenteb1e8bd6e3900e3a3b9776cd1b09ecfc05573619 (diff)
gpio: ftgpio: Move hardware initialization
It is probably wise to initialize the hardware before registering the irq chip. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20190819082704.14237-1-linus.walleij@linaro.org
Diffstat (limited to 'drivers/gpio/gpio-ftgpio010.c')
-rw-r--r--drivers/gpio/gpio-ftgpio010.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-ftgpio010.c b/drivers/gpio/gpio-ftgpio010.c
index 250e71f3e688..3118d282514a 100644
--- a/drivers/gpio/gpio-ftgpio010.c
+++ b/drivers/gpio/gpio-ftgpio010.c
@@ -296,10 +296,6 @@ static int ftgpio_gpio_probe(struct platform_device *pdev)
girq->handler = handle_bad_irq;
girq->parents[0] = irq;
- ret = devm_gpiochip_add_data(dev, &g->gc, g);
- if (ret)
- goto dis_clk;
-
/* Disable, unmask and clear all interrupts */
writel(0x0, g->base + GPIO_INT_EN);
writel(0x0, g->base + GPIO_INT_MASK);
@@ -308,6 +304,10 @@ static int ftgpio_gpio_probe(struct platform_device *pdev)
/* Clear any use of debounce */
writel(0x0, g->base + GPIO_DEBOUNCE_EN);
+ ret = devm_gpiochip_add_data(dev, &g->gc, g);
+ if (ret)
+ goto dis_clk;
+
platform_set_drvdata(pdev, g);
dev_info(dev, "FTGPIO010 @%p registered\n", g->base);