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

gpio: zevio: Use of_mm_gpiochip_remove

Since d621e8bae5ac9c67 (Create of_mm_gpiochip_remove), there is a
counterpart for of_mm_gpiochip_add.

This patch implements the remove function of the driver making use of
it.

Cc: Alexandre Courbot <gnurou@gmail.com>
Cc: Fabian Vogt <fabian@ritter-vogt.de>
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Ricardo Ribalda Delgado and committed by
Linus Walleij
ff00be69 da238221

+12
+12
drivers/gpio/gpio-zevio.c
··· 181 181 if (!controller) 182 182 return -ENOMEM; 183 183 184 + platform_set_drvdata(pdev, controller); 185 + 184 186 /* Copy our reference */ 185 187 controller->chip.gc = zevio_gpio_chip; 186 188 controller->chip.gc.dev = &pdev->dev; ··· 204 202 return 0; 205 203 } 206 204 205 + static int zevio_gpio_remove(struct platform_device *pdev) 206 + { 207 + struct zevio_gpio *controller = platform_get_drvdata(pdev); 208 + 209 + of_mm_gpiochip_remove(&controller->chip); 210 + 211 + return 0; 212 + } 213 + 207 214 static const struct of_device_id zevio_gpio_of_match[] = { 208 215 { .compatible = "lsi,zevio-gpio", }, 209 216 { }, ··· 226 215 .of_match_table = zevio_gpio_of_match, 227 216 }, 228 217 .probe = zevio_gpio_probe, 218 + .remove = zevio_gpio_remove, 229 219 }; 230 220 module_platform_driver(zevio_gpio_driver); 231 221