mtd: omap2: correct 'info' pointer in 'omap_nand_remove'

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Fri Feb 26 11:59:01 EST 2010


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=f35b6eda5184e46bf2393d8970b4b9498daf7bcf
Commit:     f35b6eda5184e46bf2393d8970b4b9498daf7bcf
Parent:     bdaefc41627b6f2815ef7aa476dfa4ebb3ad499f
Author:     Vimal Singh <vimalsingh at ti.com>
AuthorDate: Tue Jan 5 16:01:08 2010 +0530
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Fri Feb 26 16:47:39 2010 +0000

    mtd: omap2: correct 'info' pointer in 'omap_nand_remove'
    
    Removing OMAP NAND driver, when loaded as a module, gives error and
    does not get success. This fixes this and makes driver loadable and
    removable run time.
    
    Signed-off-by: Vimal Singh <vimalsingh at ti.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nand/omap2.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 4eea97c..16120e2 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1054,7 +1054,8 @@ out_free_info:
 static int omap_nand_remove(struct platform_device *pdev)
 {
 	struct mtd_info *mtd = platform_get_drvdata(pdev);
-	struct omap_nand_info *info = mtd->priv;
+	struct omap_nand_info *info = container_of(mtd, struct omap_nand_info,
+							mtd);
 
 	platform_set_drvdata(pdev, NULL);
 	if (use_dma)



More information about the linux-mtd-cvs mailing list