diff options
author | Jamie Iles <jamie@jamieiles.com> | 2011-05-23 05:23:10 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-05-24 21:22:04 -0400 |
commit | f6c11c1826a6ed853019cf2bdf51489d10c07642 (patch) | |
tree | 8219f2427ee2d6f90f03f063522fbbb1d38b092d | |
parent | 2fe2e24ead67530d624e0bb23da9f0bfdec44f8c (diff) |
mtd: scx200_docflash: convert to mtd_device_register()
Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.
Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
-rw-r--r-- | drivers/mtd/maps/Kconfig | 2 | ||||
-rw-r--r-- | drivers/mtd/maps/scx200_docflash.c | 16 |
2 files changed, 4 insertions, 14 deletions
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index d949eee14f14..add25a94ce4a 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig | |||
@@ -184,7 +184,7 @@ config MTD_VMAX | |||
184 | 184 | ||
185 | config MTD_SCx200_DOCFLASH | 185 | config MTD_SCx200_DOCFLASH |
186 | tristate "Flash device mapped with DOCCS on NatSemi SCx200" | 186 | tristate "Flash device mapped with DOCCS on NatSemi SCx200" |
187 | depends on SCx200 && MTD_CFI && MTD_PARTITIONS | 187 | depends on SCx200 && MTD_CFI |
188 | help | 188 | help |
189 | Enable support for a flash chip mapped using the DOCCS signal on a | 189 | Enable support for a flash chip mapped using the DOCCS signal on a |
190 | National Semiconductor SCx200 processor. | 190 | National Semiconductor SCx200 processor. |
diff --git a/drivers/mtd/maps/scx200_docflash.c b/drivers/mtd/maps/scx200_docflash.c index 027e628a4f1d..f1c1f737d0d7 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) { |