Commit f6c11c1826a6ed853019cf2bdf51489d10c07642

Authored by Jamie Iles
Committed by David Woodhouse
1 parent 2fe2e24ead

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>

Showing 2 changed files with 4 additions and 14 deletions Side-by-side Diff

drivers/mtd/maps/Kconfig
... ... @@ -184,7 +184,7 @@
184 184  
185 185 config MTD_SCx200_DOCFLASH
186 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 188 help
189 189 Enable support for a flash chip mapped using the DOCCS signal on a
190 190 National Semiconductor SCx200 processor.
drivers/mtd/maps/scx200_docflash.c
... ... @@ -44,7 +44,6 @@
44 44  
45 45 static struct mtd_info *mymtd;
46 46  
47   -#ifdef CONFIG_MTD_PARTITIONS
48 47 static struct mtd_partition partition_info[] = {
49 48 {
50 49 .name = "DOCCS Boot kernel",
51 50  
... ... @@ -68,9 +67,7 @@
68 67 },
69 68 };
70 69 #define NUM_PARTITIONS ARRAY_SIZE(partition_info)
71   -#endif
72 70  
73   -
74 71 static struct map_info scx200_docflash_map = {
75 72 .name = "NatSemi SCx200 DOCCS Flash",
76 73 };
77 74  
78 75  
... ... @@ -198,24 +195,17 @@
198 195  
199 196 mymtd->owner = THIS_MODULE;
200 197  
201   -#ifdef CONFIG_MTD_PARTITIONS
202 198 partition_info[3].offset = mymtd->size-partition_info[3].size;
203 199 partition_info[2].size = partition_info[3].offset-partition_info[2].offset;
204   - add_mtd_partitions(mymtd, partition_info, NUM_PARTITIONS);
205   -#else
206   - add_mtd_device(mymtd);
207   -#endif
  200 + mtd_device_register(mymtd, partition_info, NUM_PARTITIONS);
  201 +
208 202 return 0;
209 203 }
210 204  
211 205 static void __exit cleanup_scx200_docflash(void)
212 206 {
213 207 if (mymtd) {
214   -#ifdef CONFIG_MTD_PARTITIONS
215   - del_mtd_partitions(mymtd);
216   -#else
217   - del_mtd_device(mymtd);
218   -#endif
  208 + mtd_device_unregister(mymtd);
219 209 map_destroy(mymtd);
220 210 }
221 211 if (scx200_docflash_map.virt) {