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

gpio: mockup: use devm_irq_alloc_descs()

Use the resource managed variant of irq_alloc_descs(). This allows us
to remove gpio_mockup_remove().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Reviewed-by: Bamvor Jian Zhang <bamvor.zhangjian@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Bartosz Golaszewski and committed by
Linus Walleij
62a7ca07 f73b1548

+1 -15
+1 -15
drivers/gpio/gpio-mockup.c
··· 169 169 struct gpio_chip *gc = &chip->gc; 170 170 int irq_base, i; 171 171 172 - irq_base = irq_alloc_descs(-1, 0, gc->ngpio, 0); 172 + irq_base = devm_irq_alloc_descs(dev, -1, 0, gc->ngpio, 0); 173 173 if (irq_base < 0) 174 174 return irq_base; 175 175 ··· 373 373 return 0; 374 374 } 375 375 376 - static int gpio_mockup_remove(struct platform_device *pdev) 377 - { 378 - struct gpio_mockup_chip *chips; 379 - int i; 380 - 381 - chips = platform_get_drvdata(pdev); 382 - 383 - for (i = 0; i < gpio_mockup_params_nr >> 1; i++) 384 - irq_free_descs(chips[i].gc.irq_base, chips[i].gc.ngpio); 385 - 386 - return 0; 387 - } 388 - 389 376 static struct platform_driver gpio_mockup_driver = { 390 377 .driver = { 391 378 .name = GPIO_MOCKUP_NAME, 392 379 }, 393 380 .probe = gpio_mockup_probe, 394 - .remove = gpio_mockup_remove, 395 381 }; 396 382 397 383 static struct platform_device *pdev;