aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-xlp.c
diff options
context:
space:
mode:
authorKamlakant Patel <kamlakant.patel@broadcom.com>2016-06-05 04:30:43 -0400
committerLinus Walleij <linus.walleij@linaro.org>2016-06-08 04:52:49 -0400
commit1630a0624a1b8e8d8d9c0cb1a584c5a9d4671101 (patch)
tree3cb9f97f14ec1ab71c0d5dcad76780a48303671a /drivers/gpio/gpio-xlp.c
parent1bdb5c8e03f1dd657d8afdbd50910eaebfc822e4 (diff)
gpio: xlp: Fix vulcan IRQ descriptor allocation
irq_alloc_descs need not be called in case of Vulcan, where we use a dynamic IRQ range for GPIO interrupt numbers. Update code not to call irq_alloc_descs and pass 0 as irq_base in case of Vulcan. Signed-off-by: Kamlakant Patel <kamlakant.patel@broadcom.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/gpio/gpio-xlp.c')
-rw-r--r--drivers/gpio/gpio-xlp.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c
index 1a33a19d95b9..6acf8aa3b02d 100644
--- a/drivers/gpio/gpio-xlp.c
+++ b/drivers/gpio/gpio-xlp.c
@@ -388,14 +388,16 @@ static int xlp_gpio_probe(struct platform_device *pdev)
388 gc->get = xlp_gpio_get; 388 gc->get = xlp_gpio_get;
389 389
390 spin_lock_init(&priv->lock); 390 spin_lock_init(&priv->lock);
391 /* XLP has fixed IRQ range for GPIO interrupts */ 391
392 if (soc_type == GPIO_VARIANT_VULCAN) 392 /* XLP(MIPS) has fixed range for GPIO IRQs, Vulcan(ARM64) does not */
393 irq_base = irq_alloc_descs(-1, 0, gc->ngpio, 0); 393 if (soc_type != GPIO_VARIANT_VULCAN) {
394 else
395 irq_base = irq_alloc_descs(-1, XLP_GPIO_IRQ_BASE, gc->ngpio, 0); 394 irq_base = irq_alloc_descs(-1, XLP_GPIO_IRQ_BASE, gc->ngpio, 0);
396 if (irq_base < 0) { 395 if (irq_base < 0) {
397 dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n"); 396 dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n");
398 return irq_base; 397 return irq_base;
398 }
399 } else {
400 irq_base = 0;
399 } 401 }
400 402
401 err = gpiochip_add_data(gc, priv); 403 err = gpiochip_add_data(gc, priv);