lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 31 Aug 2014 16:51:55 +0530
From:	Pramod Gurav <pramod.gurav@...rtplayin.com>
To:	linux-kernel@...r.kernel.org
Cc:	Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>,
	Linus Walleij <linus.walleij@...aro.org>
Subject: [PATCH 4/4] pinctrl: at91: Add remove function in platform_driver at91_gpio_driver

This adds remove function in at91_gpio_driver platform_driver so that
driver can be unloaded cleanly.

CC: Jean-Christophe Plagniol-Villard <plagnioj@...osoft.com>
CC: Linus Walleij <linus.walleij@...aro.org>
Signed-off-by: Pramod Gurav <pramod.gurav@...rtplayin.com>
---
 drivers/pinctrl/pinctrl-at91.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c
index 8b8772c..92641b6 100644
--- a/drivers/pinctrl/pinctrl-at91.c
+++ b/drivers/pinctrl/pinctrl-at91.c
@@ -1646,6 +1646,7 @@ static int at91_gpio_probe(struct platform_device *pdev)
 	if (ret)
 		goto irq_setup_err;
 
+	platform_set_drvdata(pdev, at91_chip);
 	dev_info(&pdev->dev, "at address %p\n", at91_chip->regbase);
 
 	return 0;
@@ -1663,6 +1664,17 @@ err:
 	return ret;
 }
 
+static int at91_gpio_remove(struct platform_device *pdev)
+{
+	struct at91_gpio_chip *at91_chip = platform_get_drvdata(pdev);
+
+	gpiochip_remove(&at91_chip->chip);
+	clk_disable(at91_chip->clock);
+	clk_unprepare(at91_chip->clock);
+
+	return 0;
+}
+
 static struct platform_driver at91_gpio_driver = {
 	.driver = {
 		.name = "gpio-at91",
@@ -1670,6 +1682,7 @@ static struct platform_driver at91_gpio_driver = {
 		.of_match_table = at91_gpio_of_match,
 	},
 	.probe = at91_gpio_probe,
+	.remove = at91_gpio_remove,
 };
 
 static struct platform_driver at91_pinctrl_driver = {
-- 
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists