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  linux-hardening  linux-cve-announce  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]
Message-Id: <1410866268-15185-3-git-send-email-pramod.gurav@smartplayin.com>
Date:	Tue, 16 Sep 2014 16:47:45 +0530
From:	Pramod Gurav <pramod.gurav@...rtplayin.com>
To:	linux-kernel@...r.kernel.org
Cc:	David Brown <davidb@...eaurora.org>,
	Daniel Walker <dwalker@...o99.com>,
	Bryan Huntsman <bryanh@...eaurora.org>,
	Ulf Hansson <ulf.hansson@...aro.org>,
	linux-mmc@...r.kernel.org, linux-arm-msm@...r.kernel.org
Subject: [PATCH 2/5] mmc: msm_sdcc: Add support for platform_driver remove function

This change adds remove function in platform_driver to clean unloading

Cc: David Brown <davidb@...eaurora.org>
Cc: Daniel Walker <dwalker@...o99.com>
Cc: Bryan Huntsman <bryanh@...eaurora.org>
CC: Ulf Hansson <ulf.hansson@...aro.org>
CC: linux-mmc@...r.kernel.org
CC: linux-arm-msm@...r.kernel.org
Signed-off-by: Pramod Gurav <pramod.gurav@...rtplayin.com>
---
 drivers/mmc/host/msm_sdcc.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 2b8ac9c..3e0536d 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1360,6 +1360,7 @@ msmsdcc_probe(struct platform_device *pdev)
 	if (ret)
 		goto clk_disable;
 
+	platform_set_drvdata(pdev, host);
 	mmc_set_drvdata(pdev, mmc);
 	mmc_add_host(mmc);
 
@@ -1406,6 +1407,22 @@ msmsdcc_probe(struct platform_device *pdev)
 	return ret;
 }
 
+static int msmsdcc_remove(struct platform_device *pdev)
+{
+	struct msmsdcc_host *host = platform_get_drvdata(pdev);
+
+	msmsdcc_disable_clocks(host, 0);
+	clk_unprepare(host->clk);
+	clk_unprepare(host->pclk);
+	if (host->dmares)
+		dma_free_coherent(NULL, sizeof(struct msmsdcc_nc_dmadata),
+				  host->dma.nc, host->dma.nc_busaddr);
+	tasklet_kill(&host->dma_tlet);
+	mmc_free_host(host->mmc);
+
+	return 0;
+}
+
 #ifdef CONFIG_PM
 static int
 msmsdcc_suspend(struct platform_device *dev, pm_message_t state)
@@ -1452,6 +1469,7 @@ msmsdcc_resume(struct platform_device *dev)
 
 static struct platform_driver msmsdcc_driver = {
 	.probe		= msmsdcc_probe,
+	.remove		= msmsdcc_remove,
 	.suspend	= msmsdcc_suspend,
 	.resume		= msmsdcc_resume,
 	.driver		= {
-- 
1.7.9.5

--
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