aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/ppchameleonevb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mtd/nand/ppchameleonevb.c')
-rw-r--r--drivers/mtd/nand/ppchameleonevb.c42
1 files changed, 10 insertions, 32 deletions
diff --git a/drivers/mtd/nand/ppchameleonevb.c b/drivers/mtd/nand/ppchameleonevb.c
index 93766336ab79..7e52af51a198 100644
--- a/drivers/mtd/nand/ppchameleonevb.c
+++ b/drivers/mtd/nand/ppchameleonevb.c
@@ -191,9 +191,6 @@ static int ppchameleonevb_device_ready(struct mtd_info *minfo)
191static int __init ppchameleonevb_init(void) 191static int __init ppchameleonevb_init(void)
192{ 192{
193 struct nand_chip *this; 193 struct nand_chip *this;
194 const char *part_type = 0;
195 int mtd_parts_nb = 0;
196 struct mtd_partition *mtd_parts = 0;
197 void __iomem *ppchameleon_fio_base; 194 void __iomem *ppchameleon_fio_base;
198 void __iomem *ppchameleonevb_fio_base; 195 void __iomem *ppchameleonevb_fio_base;
199 196
@@ -276,24 +273,13 @@ static int __init ppchameleonevb_init(void)
276#endif 273#endif
277 274
278 ppchameleon_mtd->name = "ppchameleon-nand"; 275 ppchameleon_mtd->name = "ppchameleon-nand";
279 mtd_parts_nb = parse_mtd_partitions(ppchameleon_mtd, NULL, &mtd_parts, 0);
280 if (mtd_parts_nb > 0)
281 part_type = "command line";
282 else
283 mtd_parts_nb = 0;
284
285 if (mtd_parts_nb == 0) {
286 if (ppchameleon_mtd->size == NAND_SMALL_SIZE)
287 mtd_parts = partition_info_me;
288 else
289 mtd_parts = partition_info_hi;
290 mtd_parts_nb = NUM_PARTITIONS;
291 part_type = "static";
292 }
293 276
294 /* Register the partitions */ 277 /* Register the partitions */
295 printk(KERN_NOTICE "Using %s partition definition\n", part_type); 278 mtd_device_parse_register(ppchameleon_mtd, NULL, 0,
296 mtd_device_register(ppchameleon_mtd, mtd_parts, mtd_parts_nb); 279 ppchameleon_mtd->size == NAND_SMALL_SIZE ?
280 partition_info_me :
281 partition_info_hi,
282 NUM_PARTITIONS);
297 283
298 nand_evb_init: 284 nand_evb_init:
299 /**************************** 285 /****************************
@@ -377,21 +363,13 @@ static int __init ppchameleonevb_init(void)
377 } 363 }
378 364
379 ppchameleonevb_mtd->name = NAND_EVB_MTD_NAME; 365 ppchameleonevb_mtd->name = NAND_EVB_MTD_NAME;
380 mtd_parts_nb = parse_mtd_partitions(ppchameleonevb_mtd, NULL, &mtd_parts, 0);
381 if (mtd_parts_nb > 0)
382 part_type = "command line";
383 else
384 mtd_parts_nb = 0;
385
386 if (mtd_parts_nb == 0) {
387 mtd_parts = partition_info_evb;
388 mtd_parts_nb = NUM_PARTITIONS;
389 part_type = "static";
390 }
391 366
392 /* Register the partitions */ 367 /* Register the partitions */
393 printk(KERN_NOTICE "Using %s partition definition\n", part_type); 368 mtd_device_parse_register(ppchameleonevb_mtd, NULL, 0,
394 mtd_device_register(ppchameleonevb_mtd, mtd_parts, mtd_parts_nb); 369 ppchameleon_mtd->size == NAND_SMALL_SIZE ?
370 partition_info_me :
371 partition_info_hi,
372 NUM_PARTITIONS);
395 373
396 /* Return happy */ 374 /* Return happy */
397 return 0; 375 return 0;