diff options
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/nand/s3c2410.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/mtd/nand/s3c2410.c b/drivers/mtd/nand/s3c2410.c index 87c40deb27bb..ef5665258968 100644 --- a/drivers/mtd/nand/s3c2410.c +++ b/drivers/mtd/nand/s3c2410.c | |||
@@ -699,17 +699,31 @@ static int s3c24xx_nand_remove(struct platform_device *pdev) | |||
699 | } | 699 | } |
700 | 700 | ||
701 | #ifdef CONFIG_MTD_PARTITIONS | 701 | #ifdef CONFIG_MTD_PARTITIONS |
702 | const char *part_probes[] = { "cmdlinepart", NULL }; | ||
702 | static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info, | 703 | static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info, |
703 | struct s3c2410_nand_mtd *mtd, | 704 | struct s3c2410_nand_mtd *mtd, |
704 | struct s3c2410_nand_set *set) | 705 | struct s3c2410_nand_set *set) |
705 | { | 706 | { |
707 | struct mtd_partition *part_info; | ||
708 | int nr_part = 0; | ||
709 | |||
706 | if (set == NULL) | 710 | if (set == NULL) |
707 | return add_mtd_device(&mtd->mtd); | 711 | return add_mtd_device(&mtd->mtd); |
708 | 712 | ||
709 | if (set->nr_partitions > 0 && set->partitions != NULL) { | 713 | if (set->nr_partitions == 0) { |
710 | return add_mtd_partitions(&mtd->mtd, set->partitions, set->nr_partitions); | 714 | mtd->mtd.name = set->name; |
715 | nr_part = parse_mtd_partitions(&mtd->mtd, part_probes, | ||
716 | &part_info, 0); | ||
717 | } else { | ||
718 | if (set->nr_partitions > 0 && set->partitions != NULL) { | ||
719 | nr_part = set->nr_partitions; | ||
720 | part_info = set->partitions; | ||
721 | } | ||
711 | } | 722 | } |
712 | 723 | ||
724 | if (nr_part > 0 && part_info) | ||
725 | return add_mtd_partitions(&mtd->mtd, part_info, nr_part); | ||
726 | |||
713 | return add_mtd_device(&mtd->mtd); | 727 | return add_mtd_device(&mtd->mtd); |
714 | } | 728 | } |
715 | #else | 729 | #else |