diff options
-rw-r--r-- | drivers/mtd/nand/cs553x_nand.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/mtd/nand/cs553x_nand.c b/drivers/mtd/nand/cs553x_nand.c index 71c35a0b9826..f59ad1f2d5db 100644 --- a/drivers/mtd/nand/cs553x_nand.c +++ b/drivers/mtd/nand/cs553x_nand.c | |||
@@ -277,22 +277,15 @@ static int is_geode(void) | |||
277 | return 0; | 277 | return 0; |
278 | } | 278 | } |
279 | 279 | ||
280 | |||
281 | #ifdef CONFIG_MTD_PARTITIONS | ||
282 | static const char *part_probes[] = { "cmdlinepart", NULL }; | 280 | static const char *part_probes[] = { "cmdlinepart", NULL }; |
283 | #endif | ||
284 | |||
285 | 281 | ||
286 | static int __init cs553x_init(void) | 282 | static int __init cs553x_init(void) |
287 | { | 283 | { |
288 | int err = -ENXIO; | 284 | int err = -ENXIO; |
289 | int i; | 285 | int i; |
290 | uint64_t val; | 286 | uint64_t val; |
291 | |||
292 | #ifdef CONFIG_MTD_PARTITIONS | ||
293 | int mtd_parts_nb = 0; | 287 | int mtd_parts_nb = 0; |
294 | struct mtd_partition *mtd_parts = NULL; | 288 | struct mtd_partition *mtd_parts = NULL; |
295 | #endif | ||
296 | 289 | ||
297 | /* If the CPU isn't a Geode GX or LX, abort */ | 290 | /* If the CPU isn't a Geode GX or LX, abort */ |
298 | if (!is_geode()) | 291 | if (!is_geode()) |
@@ -324,17 +317,11 @@ static int __init cs553x_init(void) | |||
324 | if (cs553x_mtd[i]) { | 317 | if (cs553x_mtd[i]) { |
325 | 318 | ||
326 | /* If any devices registered, return success. Else the last error. */ | 319 | /* If any devices registered, return success. Else the last error. */ |
327 | #ifdef CONFIG_MTD_PARTITIONS | ||
328 | mtd_parts_nb = parse_mtd_partitions(cs553x_mtd[i], part_probes, &mtd_parts, 0); | 320 | mtd_parts_nb = parse_mtd_partitions(cs553x_mtd[i], part_probes, &mtd_parts, 0); |
329 | if (mtd_parts_nb > 0) { | 321 | if (mtd_parts_nb > 0) |
330 | printk(KERN_NOTICE "Using command line partition definition\n"); | 322 | printk(KERN_NOTICE "Using command line partition definition\n"); |
331 | add_mtd_partitions(cs553x_mtd[i], mtd_parts, mtd_parts_nb); | 323 | mtd_device_register(cs553x_mtd[i], mtd_parts, |
332 | } else { | 324 | mtd_parts_nb); |
333 | add_mtd_device(cs553x_mtd[i]); | ||
334 | } | ||
335 | #else | ||
336 | add_mtd_device(cs553x_mtd[i]); | ||
337 | #endif | ||
338 | err = 0; | 325 | err = 0; |
339 | } | 326 | } |
340 | } | 327 | } |