Commit c05235d5 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'gpio-v4.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio

Pull GPIO fixes from Linus Walleij:
 - Probe errorpath fix for the Altera
 - irqchip ofnode pointer added to the DaVinci driver
 - controller instance number correction for DaVinci

* tag 'gpio-v4.5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  gpio: davinci: Fix the number of controllers allocated
  gpio: davinci: Add the missing of-node pointer
  gpio: gpio-altera: Remove gpiochip on probe failure.
parents da2f912a 6ec9249a
...@@ -312,8 +312,8 @@ static int altera_gpio_probe(struct platform_device *pdev) ...@@ -312,8 +312,8 @@ static int altera_gpio_probe(struct platform_device *pdev)
handle_simple_irq, IRQ_TYPE_NONE); handle_simple_irq, IRQ_TYPE_NONE);
if (ret) { if (ret) {
dev_info(&pdev->dev, "could not add irqchip\n"); dev_err(&pdev->dev, "could not add irqchip\n");
return ret; goto teardown;
} }
gpiochip_set_chained_irqchip(&altera_gc->mmchip.gc, gpiochip_set_chained_irqchip(&altera_gc->mmchip.gc,
...@@ -326,6 +326,7 @@ static int altera_gpio_probe(struct platform_device *pdev) ...@@ -326,6 +326,7 @@ static int altera_gpio_probe(struct platform_device *pdev)
skip_irq: skip_irq:
return 0; return 0;
teardown: teardown:
of_mm_gpiochip_remove(&altera_gc->mmchip);
pr_err("%s: registration failed with status %d\n", pr_err("%s: registration failed with status %d\n",
node->full_name, ret); node->full_name, ret);
......
...@@ -195,7 +195,7 @@ static int davinci_gpio_of_xlate(struct gpio_chip *gc, ...@@ -195,7 +195,7 @@ static int davinci_gpio_of_xlate(struct gpio_chip *gc,
static int davinci_gpio_probe(struct platform_device *pdev) static int davinci_gpio_probe(struct platform_device *pdev)
{ {
int i, base; int i, base;
unsigned ngpio; unsigned ngpio, nbank;
struct davinci_gpio_controller *chips; struct davinci_gpio_controller *chips;
struct davinci_gpio_platform_data *pdata; struct davinci_gpio_platform_data *pdata;
struct davinci_gpio_regs __iomem *regs; struct davinci_gpio_regs __iomem *regs;
...@@ -224,8 +224,9 @@ static int davinci_gpio_probe(struct platform_device *pdev) ...@@ -224,8 +224,9 @@ static int davinci_gpio_probe(struct platform_device *pdev)
if (WARN_ON(ARCH_NR_GPIOS < ngpio)) if (WARN_ON(ARCH_NR_GPIOS < ngpio))
ngpio = ARCH_NR_GPIOS; ngpio = ARCH_NR_GPIOS;
nbank = DIV_ROUND_UP(ngpio, 32);
chips = devm_kzalloc(dev, chips = devm_kzalloc(dev,
ngpio * sizeof(struct davinci_gpio_controller), nbank * sizeof(struct davinci_gpio_controller),
GFP_KERNEL); GFP_KERNEL);
if (!chips) if (!chips)
return -ENOMEM; return -ENOMEM;
...@@ -511,7 +512,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev) ...@@ -511,7 +512,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)
return irq; return irq;
} }
irq_domain = irq_domain_add_legacy(NULL, ngpio, irq, 0, irq_domain = irq_domain_add_legacy(dev->of_node, ngpio, irq, 0,
&davinci_gpio_irq_ops, &davinci_gpio_irq_ops,
chips); chips);
if (!irq_domain) { if (!irq_domain) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment