diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-02-11 14:25:55 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-02-11 14:25:55 -0500 |
commit | c05235d50f681bf685e7290cae05ab3b4fa493f3 (patch) | |
tree | 6004c6e573b5fe0ec98961250dbacf758fb64ce5 | |
parent | da2f912aef1106144c43b75f8719807dfad121b3 (diff) | |
parent | 6ec9249a83b00a754af435ed57ad02ffed105d93 (diff) |
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.
-rw-r--r-- | drivers/gpio/gpio-altera.c | 5 | ||||
-rw-r--r-- | drivers/gpio/gpio-davinci.c | 7 |
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c index 2aeaebd1c6e7..3f87a03abc22 100644 --- a/drivers/gpio/gpio-altera.c +++ b/drivers/gpio/gpio-altera.c | |||
@@ -312,8 +312,8 @@ static int altera_gpio_probe(struct platform_device *pdev) | |||
312 | handle_simple_irq, IRQ_TYPE_NONE); | 312 | handle_simple_irq, IRQ_TYPE_NONE); |
313 | 313 | ||
314 | if (ret) { | 314 | if (ret) { |
315 | dev_info(&pdev->dev, "could not add irqchip\n"); | 315 | dev_err(&pdev->dev, "could not add irqchip\n"); |
316 | return ret; | 316 | goto teardown; |
317 | } | 317 | } |
318 | 318 | ||
319 | gpiochip_set_chained_irqchip(&altera_gc->mmchip.gc, | 319 | gpiochip_set_chained_irqchip(&altera_gc->mmchip.gc, |
@@ -326,6 +326,7 @@ static int altera_gpio_probe(struct platform_device *pdev) | |||
326 | skip_irq: | 326 | skip_irq: |
327 | return 0; | 327 | return 0; |
328 | teardown: | 328 | teardown: |
329 | of_mm_gpiochip_remove(&altera_gc->mmchip); | ||
329 | pr_err("%s: registration failed with status %d\n", | 330 | pr_err("%s: registration failed with status %d\n", |
330 | node->full_name, ret); | 331 | node->full_name, ret); |
331 | 332 | ||
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index ec58f4288649..cd007a67b302 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c | |||
@@ -195,7 +195,7 @@ static int davinci_gpio_of_xlate(struct gpio_chip *gc, | |||
195 | static int davinci_gpio_probe(struct platform_device *pdev) | 195 | static int davinci_gpio_probe(struct platform_device *pdev) |
196 | { | 196 | { |
197 | int i, base; | 197 | int i, base; |
198 | unsigned ngpio; | 198 | unsigned ngpio, nbank; |
199 | struct davinci_gpio_controller *chips; | 199 | struct davinci_gpio_controller *chips; |
200 | struct davinci_gpio_platform_data *pdata; | 200 | struct davinci_gpio_platform_data *pdata; |
201 | struct davinci_gpio_regs __iomem *regs; | 201 | struct davinci_gpio_regs __iomem *regs; |
@@ -224,8 +224,9 @@ static int davinci_gpio_probe(struct platform_device *pdev) | |||
224 | if (WARN_ON(ARCH_NR_GPIOS < ngpio)) | 224 | if (WARN_ON(ARCH_NR_GPIOS < ngpio)) |
225 | ngpio = ARCH_NR_GPIOS; | 225 | ngpio = ARCH_NR_GPIOS; |
226 | 226 | ||
227 | nbank = DIV_ROUND_UP(ngpio, 32); | ||
227 | chips = devm_kzalloc(dev, | 228 | chips = devm_kzalloc(dev, |
228 | ngpio * sizeof(struct davinci_gpio_controller), | 229 | nbank * sizeof(struct davinci_gpio_controller), |
229 | GFP_KERNEL); | 230 | GFP_KERNEL); |
230 | if (!chips) | 231 | if (!chips) |
231 | return -ENOMEM; | 232 | return -ENOMEM; |
@@ -511,7 +512,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev) | |||
511 | return irq; | 512 | return irq; |
512 | } | 513 | } |
513 | 514 | ||
514 | irq_domain = irq_domain_add_legacy(NULL, ngpio, irq, 0, | 515 | irq_domain = irq_domain_add_legacy(dev->of_node, ngpio, irq, 0, |
515 | &davinci_gpio_irq_ops, | 516 | &davinci_gpio_irq_ops, |
516 | chips); | 517 | chips); |
517 | if (!irq_domain) { | 518 | if (!irq_domain) { |