[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1605201148-4508-7-git-send-email-srinivas.neeli@xilinx.com>
Date: Thu, 12 Nov 2020 22:42:25 +0530
From: Srinivas Neeli <srinivas.neeli@...inx.com>
To: <linus.walleij@...aro.org>, <bgolaszewski@...libre.com>,
<michal.simek@...inx.com>, <shubhrajyoti.datta@...inx.com>,
<sgoud@...inx.com>, <hancock@...systems.ca>
CC: <linux-gpio@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <git@...inx.com>,
Srinivas Neeli <srinivas.neeli@...inx.com>
Subject: [LINUX PATCH V3 6/9] gpio: gpio-xilinx: Add remove function
Added remove function support.
Signed-off-by: Srinivas Neeli <srinivas.neeli@...inx.com>
---
Changes in V3:
-Created new patch for remove function.
---
drivers/gpio/gpio-xilinx.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/gpio/gpio-xilinx.c b/drivers/gpio/gpio-xilinx.c
index 855550a06ded..9abef56eca32 100644
--- a/drivers/gpio/gpio-xilinx.c
+++ b/drivers/gpio/gpio-xilinx.c
@@ -453,6 +453,24 @@ static void xgpio_irqhandler(struct irq_desc *desc)
}
/**
+ * 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);
+ pm_runtime_disable(&pdev->dev);
+
+ return 0;
+}
+
+/**
* xgpio_of_probe - Probe method for the GPIO device.
* @pdev: pointer to the platform device
*
@@ -601,6 +619,7 @@ MODULE_DEVICE_TABLE(of, xgpio_of_match);
static struct platform_driver xgpio_plat_driver = {
.probe = xgpio_probe,
+ .remove = xgpio_remove,
.driver = {
.name = "gpio-xilinx",
.of_match_table = xgpio_of_match,
--
2.7.4
Powered by blists - more mailing lists