@@ -1056,7 +1056,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)
@@ -1064,7 +1065,9 @@ static int omap_nand_remove(struct platform_device *pdev)
/* Release NAND device, its internal structures and partitions */
nand_release(&info->mtd);
+ release_mem_region(info->phys_base, NAND_IO_SIZE);
iounmap(info->nand_pref_fifo_add);
+ gpmc_cs_free(info->gpmc_cs);
kfree(&info->mtd);
return 0;
}