Commit 1630a062 authored by Kamlakant Patel's avatar Kamlakant Patel Committed by Linus Walleij

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: default avatarKamlakant Patel <kamlakant.patel@broadcom.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 1bdb5c8e
...@@ -388,15 +388,17 @@ static int xlp_gpio_probe(struct platform_device *pdev) ...@@ -388,15 +388,17 @@ static int xlp_gpio_probe(struct platform_device *pdev)
gc->get = xlp_gpio_get; gc->get = xlp_gpio_get;
spin_lock_init(&priv->lock); spin_lock_init(&priv->lock);
/* XLP has fixed IRQ range for GPIO interrupts */
if (soc_type == GPIO_VARIANT_VULCAN) /* XLP(MIPS) has fixed range for GPIO IRQs, Vulcan(ARM64) does not */
irq_base = irq_alloc_descs(-1, 0, gc->ngpio, 0); if (soc_type != GPIO_VARIANT_VULCAN) {
else
irq_base = irq_alloc_descs(-1, XLP_GPIO_IRQ_BASE, gc->ngpio, 0); irq_base = irq_alloc_descs(-1, XLP_GPIO_IRQ_BASE, gc->ngpio, 0);
if (irq_base < 0) { if (irq_base < 0) {
dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n"); dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n");
return irq_base; return irq_base;
} }
} else {
irq_base = 0;
}
err = gpiochip_add_data(gc, priv); err = gpiochip_add_data(gc, priv);
if (err < 0) if (err < 0)
......
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