aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2009-05-10 16:42:09 -0400
committerBen Dooks <ben-linux@fluff.org>2009-05-30 13:01:10 -0400
commited27f0287062236d50190d7447f6377ff4acdfad (patch)
tree67623decffc5a3fb2ca23c84bed9807892ec9bc0 /drivers/mtd
parentae7304e554642d57993b32265b817e6ae80787de (diff)
[MTD] [NAND] S3C2410: Allow commandline partition processing
This patch allows commandline partition processing to work with the s3c2410 NAND platform driver. Signed-off-by: Andy Green <andy@warcat.com> Signed-off-by: Nelson Castillo <arhuaco@freaks-unidos.net> [ben-linux@fluff.org: Change andy@openmoko.com to andy@warmcat.com] Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/s3c2410.c18
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
702const char *part_probes[] = { "cmdlinepart", NULL };
702static int s3c2410_nand_add_partition(struct s3c2410_nand_info *info, 703static 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