Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph...
[pandora-kernel.git] / drivers / mtd / nand / nomadik_nand.c
index a045a4a..b463ecf 100644 (file)
@@ -158,12 +158,7 @@ static int nomadik_nand_probe(struct platform_device *pdev)
                goto err_unmap;
        }
 
-#ifdef CONFIG_MTD_PARTITIONS
-       add_mtd_partitions(&host->mtd, pdata->parts, pdata->nparts);
-#else
-       pr_info("Registering %s as whole device\n", mtd->name);
-       add_mtd_device(mtd);
-#endif
+       mtd_device_register(&host->mtd, pdata->parts, pdata->nparts);
 
        platform_set_drvdata(pdev, host);
        return 0;
@@ -192,6 +187,7 @@ static int nomadik_nand_remove(struct platform_device *pdev)
                pdata->exit();
 
        if (host) {
+               nand_release(&host->mtd);
                iounmap(host->cmd_va);
                iounmap(host->data_va);
                iounmap(host->addr_va);