Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gpio: pch: use devres for irq generic chip

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>

authored by

Bartosz Golaszewski and committed by
Linus Walleij
e0fc5a1b 469d5943

+7 -5
+7 -5
drivers/gpio/gpio-pch.c
··· 337 337 { 338 338 struct irq_chip_generic *gc; 339 339 struct irq_chip_type *ct; 340 + int rv; 340 341 341 - gc = irq_alloc_generic_chip("pch_gpio", 1, irq_start, chip->base, 342 - handle_simple_irq); 342 + gc = devm_irq_alloc_generic_chip(chip->dev, "pch_gpio", 1, irq_start, 343 + chip->base, handle_simple_irq); 343 344 if (!gc) 344 345 return -ENOMEM; 345 346 ··· 352 351 ct->chip.irq_unmask = pch_irq_unmask; 353 352 ct->chip.irq_set_type = pch_irq_type; 354 353 355 - irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE, 356 - IRQ_NOREQUEST | IRQ_NOPROBE, 0); 354 + rv = devm_irq_setup_generic_chip(chip->dev, gc, IRQ_MSK(num), 355 + IRQ_GC_INIT_MASK_CACHE, 356 + IRQ_NOREQUEST | IRQ_NOPROBE, 0); 357 357 358 - return 0; 358 + return rv; 359 359 } 360 360 361 361 static int pch_gpio_probe(struct pci_dev *pdev,