Commit 0230a41e authored by Srinivas Neeli's avatar Srinivas Neeli Committed by Linus Walleij

gpio: gpio-xilinx: Add remove function

Added remove function support.
Signed-off-by: default avatarSrinivas Neeli <srinivas.neeli@xilinx.com>
Acked-by: default avatarMichal Simek <michal.simek@xilinx.com>
Link: https://lore.kernel.org/r/1605201148-4508-7-git-send-email-srinivas.neeli@xilinx.com
[dropped pm disable call]
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 65bbe531
...@@ -259,6 +259,23 @@ static void xgpio_save_regs(struct xgpio_instance *chip) ...@@ -259,6 +259,23 @@ static void xgpio_save_regs(struct xgpio_instance *chip)
chip->gpio_dir[1]); chip->gpio_dir[1]);
} }
/**
* xgpio_remove - Remove method for the GPIO device.
* @pdev: pointer to the platform device
*
* This function remove gpiochips and frees all the allocated resources.
*
* Return: 0 always
*/
static int xgpio_remove(struct platform_device *pdev)
{
struct xgpio_instance *gpio = platform_get_drvdata(pdev);
clk_disable_unprepare(gpio->clk);
return 0;
}
/** /**
* xgpio_of_probe - Probe method for the GPIO device. * xgpio_of_probe - Probe method for the GPIO device.
* @pdev: pointer to the platform device * @pdev: pointer to the platform device
...@@ -371,6 +388,7 @@ MODULE_DEVICE_TABLE(of, xgpio_of_match); ...@@ -371,6 +388,7 @@ MODULE_DEVICE_TABLE(of, xgpio_of_match);
static struct platform_driver xgpio_plat_driver = { static struct platform_driver xgpio_plat_driver = {
.probe = xgpio_probe, .probe = xgpio_probe,
.remove = xgpio_remove,
.driver = { .driver = {
.name = "gpio-xilinx", .name = "gpio-xilinx",
.of_match_table = xgpio_of_match, .of_match_table = xgpio_of_match,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment