diff options
author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2017-03-04 11:23:34 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2017-03-15 06:16:35 -0400 |
commit | 31bd86d9834fc1fb5bd00247358754bebabf0639 (patch) | |
tree | c0303aeacf7e3556588553a77a552679d54e774b /drivers/gpio/gpio-xlp.c | |
parent | e971ac9a564a4f3fbaeaae111079837928226870 (diff) |
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: Bartosz Golaszewski <bgolaszewski@baylibre.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.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpio/gpio-xlp.c b/drivers/gpio/gpio-xlp.c index 4620d050e5a8..7cc82cf82b82 100644 --- a/drivers/gpio/gpio-xlp.c +++ b/drivers/gpio/gpio-xlp.c | |||
@@ -404,7 +404,9 @@ static int xlp_gpio_probe(struct platform_device *pdev) | |||
404 | 404 | ||
405 | /* XLP(MIPS) has fixed range for GPIO IRQs, Vulcan(ARM64) does not */ | 405 | /* XLP(MIPS) has fixed range for GPIO IRQs, Vulcan(ARM64) does not */ |
406 | if (soc_type != GPIO_VARIANT_VULCAN) { | 406 | if (soc_type != GPIO_VARIANT_VULCAN) { |
407 | irq_base = irq_alloc_descs(-1, XLP_GPIO_IRQ_BASE, gc->ngpio, 0); | 407 | irq_base = devm_irq_alloc_descs(&pdev->dev, -1, |
408 | XLP_GPIO_IRQ_BASE, | ||
409 | gc->ngpio, 0); | ||
408 | if (irq_base < 0) { | 410 | if (irq_base < 0) { |
409 | dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n"); | 411 | dev_err(&pdev->dev, "Failed to allocate IRQ numbers\n"); |
410 | return irq_base; | 412 | return irq_base; |
@@ -415,7 +417,7 @@ static int xlp_gpio_probe(struct platform_device *pdev) | |||
415 | 417 | ||
416 | err = gpiochip_add_data(gc, priv); | 418 | err = gpiochip_add_data(gc, priv); |
417 | if (err < 0) | 419 | if (err < 0) |
418 | goto out_free_desc; | 420 | return err; |
419 | 421 | ||
420 | err = gpiochip_irqchip_add(gc, &xlp_gpio_irq_chip, irq_base, | 422 | err = gpiochip_irqchip_add(gc, &xlp_gpio_irq_chip, irq_base, |
421 | handle_level_irq, IRQ_TYPE_NONE); | 423 | handle_level_irq, IRQ_TYPE_NONE); |
@@ -433,8 +435,6 @@ static int xlp_gpio_probe(struct platform_device *pdev) | |||
433 | 435 | ||
434 | out_gpio_remove: | 436 | out_gpio_remove: |
435 | gpiochip_remove(gc); | 437 | gpiochip_remove(gc); |
436 | out_free_desc: | ||
437 | irq_free_descs(irq_base, gc->ngpio); | ||
438 | return err; | 438 | return err; |
439 | } | 439 | } |
440 | 440 | ||