aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand/generic.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/onenand/generic.c')
-rw-r--r--drivers/mtd/onenand/generic.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/mtd/onenand/generic.c b/drivers/mtd/onenand/generic.c
index 2d70d354d84..7813095264a 100644
--- a/drivers/mtd/onenand/generic.c
+++ b/drivers/mtd/onenand/generic.c
@@ -30,11 +30,8 @@
30 */ 30 */
31#define DRIVER_NAME "onenand-flash" 31#define DRIVER_NAME "onenand-flash"
32 32
33static const char *part_probes[] = { "cmdlinepart", NULL, };
34
35struct onenand_info { 33struct onenand_info {
36 struct mtd_info mtd; 34 struct mtd_info mtd;
37 struct mtd_partition *parts;
38 struct onenand_chip onenand; 35 struct onenand_chip onenand;
39}; 36};
40 37
@@ -73,13 +70,9 @@ static int __devinit generic_onenand_probe(struct platform_device *pdev)
73 goto out_iounmap; 70 goto out_iounmap;
74 } 71 }
75 72
76 err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0); 73 err = mtd_device_parse_register(&info->mtd, NULL, 0,
77 if (err > 0) 74 pdata ? pdata->parts : NULL,
78 mtd_device_register(&info->mtd, info->parts, err); 75 pdata ? pdata->nr_parts : 0);
79 else if (err <= 0 && pdata && pdata->parts)
80 mtd_device_register(&info->mtd, pdata->parts, pdata->nr_parts);
81 else
82 err = mtd_device_register(&info->mtd, NULL, 0);
83 76
84 platform_set_drvdata(pdev, info); 77 platform_set_drvdata(pdev, info);
85 78
@@ -104,7 +97,6 @@ static int __devexit generic_onenand_remove(struct platform_device *pdev)
104 platform_set_drvdata(pdev, NULL); 97 platform_set_drvdata(pdev, NULL);
105 98
106 if (info) { 99 if (info) {
107 mtd_device_unregister(&info->mtd);
108 onenand_release(&info->mtd); 100 onenand_release(&info->mtd);
109 release_mem_region(res->start, size); 101 release_mem_region(res->start, size);
110 iounmap(info->onenand.base); 102 iounmap(info->onenand.base);