mtd: spear_smi: release memory region during remove

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Mar 26 20:59:04 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=495c47d799d93ad688db9db170200eb71525ff45
Commit:     495c47d799d93ad688db9db170200eb71525ff45
Parent:     f18dbbb1bfe06ea3995b55c2f533057da9e9294a
Author:     Shiraz Hashim <shiraz.hashim at st.com>
AuthorDate: Fri Jan 20 11:35:19 2012 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Tue Mar 27 00:14:36 2012 +0100

    mtd: spear_smi: release memory region during remove
    
    Driver must cleanup all held resources during remove. It wasn't
    releasing requested memory region.
    
    Signed-off-by: Shiraz Hashim <shiraz.hashim at st.com>
    Signed-off-by: Stefan Roese <sr at denx.de>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/devices/spear_smi.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/devices/spear_smi.c b/drivers/mtd/devices/spear_smi.c
index 1eac56c..0f0f1ac 100644
--- a/drivers/mtd/devices/spear_smi.c
+++ b/drivers/mtd/devices/spear_smi.c
@@ -1024,6 +1024,7 @@ static int __devexit spear_smi_remove(struct platform_device *pdev)
 {
 	struct spear_smi *dev;
 	struct spear_snor_flash *flash;
+	struct resource *smi_base;
 	int ret;
 	int i, irq;
 
@@ -1055,6 +1056,9 @@ static int __devexit spear_smi_remove(struct platform_device *pdev)
 	clk_put(dev->clk);
 	iounmap(dev->io_base);
 	kfree(dev);
+
+	smi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	release_mem_region(smi_base->start, resource_size(smi_base));
 	platform_set_drvdata(pdev, NULL);
 
 	return 0;



More information about the linux-mtd-cvs mailing list