diff options
author | Mike Rapoport <mike@compulab.co.il> | 2009-02-17 13:54:46 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-03-20 18:37:33 +0000 |
commit | 82a72d108b4fbcc8f651b7c4e34c6f18a605d58d (patch) | |
tree | cc9d561286eca9f8696324f069309958fc94adec /drivers/mtd/nand/pxa3xx_nand.c | |
parent | b2ed3680553b451e5c45064de26ea8fa5201c6d4 (diff) | |
download | talos-obmc-linux-82a72d108b4fbcc8f651b7c4e34c6f18a605d58d.tar.gz talos-obmc-linux-82a72d108b4fbcc8f651b7c4e34c6f18a605d58d.zip |
[MTD] [NAND] pxa3xx_nand: allow building as module
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd/nand/pxa3xx_nand.c')
-rw-r--r-- | drivers/mtd/nand/pxa3xx_nand.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index ffa960baa7e7..ead4a7a72d44 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c @@ -1079,6 +1079,7 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) this = &info->nand_chip; mtd->priv = info; + mtd->owner = THIS_MODULE; info->clk = clk_get(&pdev->dev, NULL); if (IS_ERR(info->clk)) { @@ -1187,6 +1188,7 @@ static int pxa3xx_nand_remove(struct platform_device *pdev) { struct mtd_info *mtd = platform_get_drvdata(pdev); struct pxa3xx_nand_info *info = mtd->priv; + struct resource *r; platform_set_drvdata(pdev, NULL); @@ -1199,6 +1201,14 @@ static int pxa3xx_nand_remove(struct platform_device *pdev) info->data_buff, info->data_buff_phys); } else kfree(info->data_buff); + + iounmap(info->mmio_base); + r = platform_get_resource(pdev, IORESOURCE_MEM, 0); + release_mem_region(r->start, resource_size(r)); + + clk_disable(info->clk); + clk_put(info->clk); + kfree(mtd); return 0; } |