diff options
-rw-r--r-- | drivers/pinctrl/pinctrl-at91.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index 71a8e8c4f19c..51d094cc3f10 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c | |||
@@ -1605,7 +1605,7 @@ static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
1605 | /* now it may re-trigger */ | 1605 | /* now it may re-trigger */ |
1606 | } | 1606 | } |
1607 | 1607 | ||
1608 | static int at91_gpio_of_irq_setup(struct device_node *node, | 1608 | static int at91_gpio_of_irq_setup(struct platform_device *pdev, |
1609 | struct at91_gpio_chip *at91_gpio) | 1609 | struct at91_gpio_chip *at91_gpio) |
1610 | { | 1610 | { |
1611 | struct at91_gpio_chip *prev = NULL; | 1611 | struct at91_gpio_chip *prev = NULL; |
@@ -1630,9 +1630,11 @@ static int at91_gpio_of_irq_setup(struct device_node *node, | |||
1630 | 0, | 1630 | 0, |
1631 | handle_edge_irq, | 1631 | handle_edge_irq, |
1632 | IRQ_TYPE_EDGE_BOTH); | 1632 | IRQ_TYPE_EDGE_BOTH); |
1633 | if (ret) | 1633 | if (ret) { |
1634 | panic("at91_gpio.%d: couldn't allocate irq domain (DT).\n", | 1634 | dev_err(&pdev->dev, "at91_gpio.%d: Couldn't add irqchip to gpiochip.\n", |
1635 | at91_gpio->pioc_idx); | 1635 | at91_gpio->pioc_idx); |
1636 | return ret; | ||
1637 | } | ||
1636 | 1638 | ||
1637 | /* Setup chained handler */ | 1639 | /* Setup chained handler */ |
1638 | if (at91_gpio->pioc_idx) | 1640 | if (at91_gpio->pioc_idx) |
@@ -1800,12 +1802,16 @@ static int at91_gpio_probe(struct platform_device *pdev) | |||
1800 | 1802 | ||
1801 | at91_gpio_probe_fixup(); | 1803 | at91_gpio_probe_fixup(); |
1802 | 1804 | ||
1803 | at91_gpio_of_irq_setup(np, at91_chip); | 1805 | ret = at91_gpio_of_irq_setup(pdev, at91_chip); |
1806 | if (ret) | ||
1807 | goto irq_setup_err; | ||
1804 | 1808 | ||
1805 | dev_info(&pdev->dev, "at address %p\n", at91_chip->regbase); | 1809 | dev_info(&pdev->dev, "at address %p\n", at91_chip->regbase); |
1806 | 1810 | ||
1807 | return 0; | 1811 | return 0; |
1808 | 1812 | ||
1813 | irq_setup_err: | ||
1814 | gpiochip_remove(chip); | ||
1809 | gpiochip_add_err: | 1815 | gpiochip_add_err: |
1810 | clk_disable(at91_chip->clock); | 1816 | clk_disable(at91_chip->clock); |
1811 | clk_enable_err: | 1817 | clk_enable_err: |