OSDN Git Service

gpio: xlp: Fix vulcan IRQ descriptor allocation
authorKamlakant Patel <kamlakant.patel@broadcom.com>
Sun, 5 Jun 2016 08:30:43 +0000 (14:00 +0530)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 8 Jun 2016 08:52:49 +0000 (10:52 +0200)
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>
drivers/gpio/gpio-xlp.c

index 1a33a19..6acf8aa 100644 (file)
@@ -388,14 +388,16 @@ static int xlp_gpio_probe(struct platform_device *pdev)
        gc->get = xlp_gpio_get;
 
        spin_lock_init(&priv->lock);
-       /* XLP has fixed IRQ range for GPIO interrupts */
-       if (soc_type == GPIO_VARIANT_VULCAN)
-               irq_base = irq_alloc_descs(-1, 0, gc->ngpio, 0);
-       else
+
+       /* XLP(MIPS) has fixed range for GPIO IRQs, Vulcan(ARM64) does not */
+       if (soc_type != GPIO_VARIANT_VULCAN) {
                irq_base = irq_alloc_descs(-1, XLP_GPIO_IRQ_BASE, gc->ngpio, 0);
-       if (irq_base < 0) {
-               dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n");
-               return irq_base;
+               if (irq_base < 0) {
+                       dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n");
+                       return irq_base;
+               }
+       } else {
+               irq_base = 0;
        }
 
        err = gpiochip_add_data(gc, priv);