|
@@ -1119,10 +1119,7 @@ static int pxa3xx_nand_remove(struct platform_device *pdev)
|
|
|
clk_put(info->clk);
|
|
|
|
|
|
if (mtd) {
|
|
|
- del_mtd_device(mtd);
|
|
|
-#ifdef CONFIG_MTD_PARTITIONS
|
|
|
- del_mtd_partitions(mtd);
|
|
|
-#endif
|
|
|
+ mtd_device_unregister(mtd);
|
|
|
kfree(mtd);
|
|
|
}
|
|
|
return 0;
|
|
@@ -1149,7 +1146,6 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
|
|
|
return -ENODEV;
|
|
|
}
|
|
|
|
|
|
-#ifdef CONFIG_MTD_PARTITIONS
|
|
|
if (mtd_has_cmdlinepart()) {
|
|
|
const char *probes[] = { "cmdlinepart", NULL };
|
|
|
struct mtd_partition *parts;
|
|
@@ -1158,13 +1154,10 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
|
|
|
nr_parts = parse_mtd_partitions(info->mtd, probes, &parts, 0);
|
|
|
|
|
|
if (nr_parts)
|
|
|
- return add_mtd_partitions(info->mtd, parts, nr_parts);
|
|
|
+ return mtd_device_register(info->mtd, parts, nr_parts);
|
|
|
}
|
|
|
|
|
|
- return add_mtd_partitions(info->mtd, pdata->parts, pdata->nr_parts);
|
|
|
-#else
|
|
|
- return 0;
|
|
|
-#endif
|
|
|
+ return mtd_device_register(info->mtd, pdata->parts, pdata->nr_parts);
|
|
|
}
|
|
|
|
|
|
#ifdef CONFIG_PM
|