[PATCH] mtd: fsmc_nand: restore platform data partition support

Linus Walleij linus.walleij at stericsson.com
Tue Mar 13 08:56:45 EDT 2012


From: Linus Walleij <linus.walleij at linaro.org>

Commit 0d04eda1430e9a796214bee644b7e05d99cfe613
"mtd: fsmc_nand.c: use mtd_device_parse_register"
accidentally broke the platform data partition supply
capability in the FSMC driver, this make it work again.
Tested on the U300 that use this scheme.

Cc: stable at kernel.org
Cc: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
Signed-off-by: Linus Walleij <linus.walleij at linaro.org>
---
 drivers/mtd/nand/fsmc_nand.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index e53b760..fd9f94f 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -713,7 +713,12 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
 	 * Check for partition info passed
 	 */
 	host->mtd.name = "nand";
-	ret = mtd_device_parse_register(&host->mtd, NULL, 0,
+	if (pdata->partitions)
+		ret = mtd_device_parse_register(&host->mtd, NULL, 0,
+						pdata->partitions,
+						pdata->nr_partitions);
+	else
+		ret = mtd_device_parse_register(&host->mtd, NULL, 0,
 			host->mtd.size <= 0x04000000 ?
 				partition_info_16KB_blk :
 				partition_info_128KB_blk,
-- 
1.7.8




More information about the linux-mtd mailing list