mtd: omap2: correct 'info' pointer in 'omap_nand_remove'
authorVimal Singh <vimalsingh@ti.com>
Tue, 5 Jan 2010 10:31:08 +0000 (16:01 +0530)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Fri, 26 Feb 2010 16:47:39 +0000 (16:47 +0000)
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@ti.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nand/omap2.c

index 4eea97c..16120e2 100644 (file)
@@ -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)