[MTD] [NAND] at91_nand: Make mtdparts option can override board info

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sun Feb 3 02:59:01 EST 2008


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=842b1a105c95d22c3e4257879539413d3152629e
Commit:     842b1a105c95d22c3e4257879539413d3152629e
Parent:     79dcd8e9e1f2864ade80f45e144e5e80fef71613
Author:     Atsushi Nemoto <anemo at mba.ocn.ne.jp>
AuthorDate: Tue Jan 29 22:28:22 2008 +0900
Committer:  David Woodhouse <dwmw2 at infradead.org>
CommitDate: Sun Feb 3 18:21:01 2008 +1100

    [MTD] [NAND] at91_nand: Make mtdparts option can override board info
    
    Call parse_mtd_partitions before checking board's partition_info, so
    that "mtdparts=" option can override board's default setting.
    
    Signed-off-by: Atsushi Nemoto <anemo at mba.ocn.ne.jp>
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
 drivers/mtd/nand/at91_nand.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/at91_nand.c b/drivers/mtd/nand/at91_nand.c
index b2a5672..c9fb2ac 100644
--- a/drivers/mtd/nand/at91_nand.c
+++ b/drivers/mtd/nand/at91_nand.c
@@ -156,14 +156,14 @@ static int __init at91_nand_probe(struct platform_device *pdev)
 	}
 
 #ifdef CONFIG_MTD_PARTITIONS
-	if (host->board->partition_info)
-		partitions = host->board->partition_info(mtd->size, &num_partitions);
 #ifdef CONFIG_MTD_CMDLINE_PARTS
-	else {
-		mtd->name = "at91_nand";
-		num_partitions = parse_mtd_partitions(mtd, part_probes, &partitions, 0);
-	}
+	mtd->name = "at91_nand";
+	num_partitions = parse_mtd_partitions(mtd, part_probes,
+					      &partitions, 0);
 #endif
+	if (num_partitions <= 0 && host->board->partition_info)
+		partitions = host->board->partition_info(mtd->size,
+							 &num_partitions);
 
 	if ((!partitions) || (num_partitions == 0)) {
 		printk(KERN_ERR "at91_nand: No parititions defined, or unsupported device.\n");



More information about the linux-mtd-cvs mailing list