gpio: pch: use devres for irq generic chip
authorBartosz Golaszewski <brgl@bgdev.pl>
Wed, 9 Aug 2017 12:25:05 +0000 (14:25 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Sun, 20 Aug 2017 22:08:52 +0000 (00:08 +0200)
Use resource managed variants of irq_alloc_generic_chip() and
irq_setup_generic_chip().

Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/gpio/gpio-pch.c

index f6600f8ada520645bad21728c52252c67f196a0b..68c6d0c5a6d19362d6f5dfb9979080415acf8c42 100644 (file)
@@ -337,9 +337,10 @@ static int pch_gpio_alloc_generic_chip(struct pch_gpio *chip,
 {
        struct irq_chip_generic *gc;
        struct irq_chip_type *ct;
+       int rv;
 
-       gc = irq_alloc_generic_chip("pch_gpio", 1, irq_start, chip->base,
-                                   handle_simple_irq);
+       gc = devm_irq_alloc_generic_chip(chip->dev, "pch_gpio", 1, irq_start,
+                                        chip->base, handle_simple_irq);
        if (!gc)
                return -ENOMEM;
 
@@ -351,10 +352,11 @@ static int pch_gpio_alloc_generic_chip(struct pch_gpio *chip,
        ct->chip.irq_unmask = pch_irq_unmask;
        ct->chip.irq_set_type = pch_irq_type;
 
-       irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
-                              IRQ_NOREQUEST | IRQ_NOPROBE, 0);
+       rv = devm_irq_setup_generic_chip(chip->dev, gc, IRQ_MSK(num),
+                                        IRQ_GC_INIT_MASK_CACHE,
+                                        IRQ_NOREQUEST | IRQ_NOPROBE, 0);
 
-       return 0;
+       return rv;
 }
 
 static int pch_gpio_probe(struct pci_dev *pdev,