Skip to content

Commit 56b16a9

Browse files
glneoandy-shev
authored andcommitted
gpio: ich: Use devm_gpiochip_add_data() to simplify remove path
Use devm version of gpiochip add function to handle removal for us. Signed-off-by: Andrew Davis <afd@ti.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
1 parent 9409d8c commit 56b16a9

1 file changed

Lines changed: 1 addition & 9 deletions

File tree

drivers/gpio/gpio-ich.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ static int ichx_gpio_probe(struct platform_device *pdev)
457457

458458
init:
459459
ichx_gpiolib_setup(&ichx_priv.chip);
460-
err = gpiochip_add_data(&ichx_priv.chip, NULL);
460+
err = devm_gpiochip_add_data(dev, &ichx_priv.chip, NULL);
461461
if (err) {
462462
dev_err(dev, "Failed to register GPIOs\n");
463463
return err;
@@ -469,19 +469,11 @@ static int ichx_gpio_probe(struct platform_device *pdev)
469469
return 0;
470470
}
471471

472-
static int ichx_gpio_remove(struct platform_device *pdev)
473-
{
474-
gpiochip_remove(&ichx_priv.chip);
475-
476-
return 0;
477-
}
478-
479472
static struct platform_driver ichx_gpio_driver = {
480473
.driver = {
481474
.name = DRV_NAME,
482475
},
483476
.probe = ichx_gpio_probe,
484-
.remove = ichx_gpio_remove,
485477
};
486478

487479
module_platform_driver(ichx_gpio_driver);

0 commit comments

Comments
 (0)