Commit 31bd86d9 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Linus Walleij

gpio: xlp: use resource management for irqs

Use the resource managed variant of irq_alloc_descs() and remove the
code manually freeing allocated interrupt descriptors.
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent e971ac9a
...@@ -404,7 +404,9 @@ static int xlp_gpio_probe(struct platform_device *pdev) ...@@ -404,7 +404,9 @@ static int xlp_gpio_probe(struct platform_device *pdev)
/* XLP(MIPS) has fixed range for GPIO IRQs, Vulcan(ARM64) does not */ /* XLP(MIPS) has fixed range for GPIO IRQs, Vulcan(ARM64) does not */
if (soc_type != GPIO_VARIANT_VULCAN) { if (soc_type != GPIO_VARIANT_VULCAN) {
irq_base = irq_alloc_descs(-1, XLP_GPIO_IRQ_BASE, gc->ngpio, 0); irq_base = devm_irq_alloc_descs(&pdev->dev, -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;
...@@ -415,7 +417,7 @@ static int xlp_gpio_probe(struct platform_device *pdev) ...@@ -415,7 +417,7 @@ static int xlp_gpio_probe(struct platform_device *pdev)
err = gpiochip_add_data(gc, priv); err = gpiochip_add_data(gc, priv);
if (err < 0) if (err < 0)
goto out_free_desc; return err;
err = gpiochip_irqchip_add(gc, &xlp_gpio_irq_chip, irq_base, err = gpiochip_irqchip_add(gc, &xlp_gpio_irq_chip, irq_base,
handle_level_irq, IRQ_TYPE_NONE); handle_level_irq, IRQ_TYPE_NONE);
...@@ -433,8 +435,6 @@ static int xlp_gpio_probe(struct platform_device *pdev) ...@@ -433,8 +435,6 @@ static int xlp_gpio_probe(struct platform_device *pdev)
out_gpio_remove: out_gpio_remove:
gpiochip_remove(gc); gpiochip_remove(gc);
out_free_desc:
irq_free_descs(irq_base, gc->ngpio);
return err; return err;
} }
......
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