diff mbox

mtd: fsmc_nand: restore platform data partition support

Message ID 1331643405-759-1-git-send-email-linus.walleij@stericsson.com
State Superseded
Headers show

Commit Message

Linus Walleij March 13, 2012, 12:56 p.m. UTC
From: Linus Walleij <linus.walleij@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@kernel.org
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mtd/nand/fsmc_nand.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
diff mbox

Patch

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,