diff options
Diffstat (limited to 'drivers/mtd/maps/scx200_docflash.c')
-rw-r--r-- | drivers/mtd/maps/scx200_docflash.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/mtd/maps/scx200_docflash.c b/drivers/mtd/maps/scx200_docflash.c index 027e628a4f1..f1c1f737d0d 100644 --- a/drivers/mtd/maps/scx200_docflash.c +++ b/drivers/mtd/maps/scx200_docflash.c | |||
@@ -44,7 +44,6 @@ static struct resource docmem = { | |||
44 | 44 | ||
45 | static struct mtd_info *mymtd; | 45 | static struct mtd_info *mymtd; |
46 | 46 | ||
47 | #ifdef CONFIG_MTD_PARTITIONS | ||
48 | static struct mtd_partition partition_info[] = { | 47 | static struct mtd_partition partition_info[] = { |
49 | { | 48 | { |
50 | .name = "DOCCS Boot kernel", | 49 | .name = "DOCCS Boot kernel", |
@@ -68,8 +67,6 @@ static struct mtd_partition partition_info[] = { | |||
68 | }, | 67 | }, |
69 | }; | 68 | }; |
70 | #define NUM_PARTITIONS ARRAY_SIZE(partition_info) | 69 | #define NUM_PARTITIONS ARRAY_SIZE(partition_info) |
71 | #endif | ||
72 | |||
73 | 70 | ||
74 | static struct map_info scx200_docflash_map = { | 71 | static struct map_info scx200_docflash_map = { |
75 | .name = "NatSemi SCx200 DOCCS Flash", | 72 | .name = "NatSemi SCx200 DOCCS Flash", |
@@ -198,24 +195,17 @@ static int __init init_scx200_docflash(void) | |||
198 | 195 | ||
199 | mymtd->owner = THIS_MODULE; | 196 | mymtd->owner = THIS_MODULE; |
200 | 197 | ||
201 | #ifdef CONFIG_MTD_PARTITIONS | ||
202 | partition_info[3].offset = mymtd->size-partition_info[3].size; | 198 | partition_info[3].offset = mymtd->size-partition_info[3].size; |
203 | partition_info[2].size = partition_info[3].offset-partition_info[2].offset; | 199 | partition_info[2].size = partition_info[3].offset-partition_info[2].offset; |
204 | add_mtd_partitions(mymtd, partition_info, NUM_PARTITIONS); | 200 | mtd_device_register(mymtd, partition_info, NUM_PARTITIONS); |
205 | #else | 201 | |
206 | add_mtd_device(mymtd); | ||
207 | #endif | ||
208 | return 0; | 202 | return 0; |
209 | } | 203 | } |
210 | 204 | ||
211 | static void __exit cleanup_scx200_docflash(void) | 205 | static void __exit cleanup_scx200_docflash(void) |
212 | { | 206 | { |
213 | if (mymtd) { | 207 | if (mymtd) { |
214 | #ifdef CONFIG_MTD_PARTITIONS | 208 | mtd_device_unregister(mymtd); |
215 | del_mtd_partitions(mymtd); | ||
216 | #else | ||
217 | del_mtd_device(mymtd); | ||
218 | #endif | ||
219 | map_destroy(mymtd); | 209 | map_destroy(mymtd); |
220 | } | 210 | } |
221 | if (scx200_docflash_map.virt) { | 211 | if (scx200_docflash_map.virt) { |