aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/onenand/generic.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-05-27 23:06:53 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-05-27 23:06:53 -0400
commit29a6ccca3869bbe33879dae0cd7df2a1559eff54 (patch)
tree2d9d355d8662ede95af7bc812d686dc4d5f37ff3 /drivers/mtd/onenand/generic.c
parent426048313dfa7d65dbd2379b1665755511f9544f (diff)
parent6a8a98b22b10f1560d5f90aded4a54234b9b2724 (diff)
Merge git://git.infradead.org/mtd-2.6
* git://git.infradead.org/mtd-2.6: (97 commits) mtd: kill CONFIG_MTD_PARTITIONS mtd: remove add_mtd_partitions, add_mtd_device and friends mtd: convert remaining users to mtd_device_register() mtd: samsung onenand: convert to mtd_device_register() mtd: omap2 onenand: convert to mtd_device_register() mtd: txx9ndfmc: convert to mtd_device_register() mtd: tmio_nand: convert to mtd_device_register() mtd: socrates_nand: convert to mtd_device_register() mtd: sharpsl: convert to mtd_device_register() mtd: s3c2410 nand: convert to mtd_device_register() mtd: ppchameleonevb: convert to mtd_device_register() mtd: orion_nand: convert to mtd_device_register() mtd: omap2: convert to mtd_device_register() mtd: nomadik_nand: convert to mtd_device_register() mtd: ndfc: convert to mtd_device_register() mtd: mxc_nand: convert to mtd_device_register() mtd: mpc5121_nfc: convert to mtd_device_register() mtd: jz4740_nand: convert to mtd_device_register() mtd: h1910: convert to mtd_device_register() mtd: fsmc_nand: convert to mtd_device_register() ... Fixed up trivial conflicts in - drivers/mtd/maps/integrator-flash.c: removed in ARM tree - drivers/mtd/maps/physmap.c: addition of afs partition probe type clashing with removal of CONFIG_MTD_PARTITIONS
Diffstat (limited to 'drivers/mtd/onenand/generic.c')
-rw-r--r--drivers/mtd/onenand/generic.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/drivers/mtd/onenand/generic.c b/drivers/mtd/onenand/generic.c
index ac08750748a3..2d70d354d846 100644
--- a/drivers/mtd/onenand/generic.c
+++ b/drivers/mtd/onenand/generic.c
@@ -30,9 +30,7 @@
30 */ 30 */
31#define DRIVER_NAME "onenand-flash" 31#define DRIVER_NAME "onenand-flash"
32 32
33#ifdef CONFIG_MTD_PARTITIONS
34static const char *part_probes[] = { "cmdlinepart", NULL, }; 33static const char *part_probes[] = { "cmdlinepart", NULL, };
35#endif
36 34
37struct onenand_info { 35struct onenand_info {
38 struct mtd_info mtd; 36 struct mtd_info mtd;
@@ -75,15 +73,13 @@ static int __devinit generic_onenand_probe(struct platform_device *pdev)
75 goto out_iounmap; 73 goto out_iounmap;
76 } 74 }
77 75
78#ifdef CONFIG_MTD_PARTITIONS
79 err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0); 76 err = parse_mtd_partitions(&info->mtd, part_probes, &info->parts, 0);
80 if (err > 0) 77 if (err > 0)
81 add_mtd_partitions(&info->mtd, info->parts, err); 78 mtd_device_register(&info->mtd, info->parts, err);
82 else if (err <= 0 && pdata && pdata->parts) 79 else if (err <= 0 && pdata && pdata->parts)
83 add_mtd_partitions(&info->mtd, pdata->parts, pdata->nr_parts); 80 mtd_device_register(&info->mtd, pdata->parts, pdata->nr_parts);
84 else 81 else
85#endif 82 err = mtd_device_register(&info->mtd, NULL, 0);
86 err = add_mtd_device(&info->mtd);
87 83
88 platform_set_drvdata(pdev, info); 84 platform_set_drvdata(pdev, info);
89 85
@@ -108,11 +104,7 @@ static int __devexit generic_onenand_remove(struct platform_device *pdev)
108 platform_set_drvdata(pdev, NULL); 104 platform_set_drvdata(pdev, NULL);
109 105
110 if (info) { 106 if (info) {
111 if (info->parts) 107 mtd_device_unregister(&info->mtd);
112 del_mtd_partitions(&info->mtd);
113 else
114 del_mtd_device(&info->mtd);
115
116 onenand_release(&info->mtd); 108 onenand_release(&info->mtd);
117 release_mem_region(res->start, size); 109 release_mem_region(res->start, size);
118 iounmap(info->onenand.base); 110 iounmap(info->onenand.base);