From patchwork Tue Mar 13 12:56:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: mtd: fsmc_nand: restore platform data partition support X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 146402 Message-Id: <1331643405-759-1-git-send-email-linus.walleij@stericsson.com> To: David Woodhouse , Artem Bityutskiy , Cc: Armando Visconti , Linus Walleij , Vipin Kumar , Dmitry Eremin-Solenikov , stable@kernel.org, Vincenzo Frascino Date: Tue, 13 Mar 2012 13:56:45 +0100 From: Linus Walleij List-Id: Linux MTD discussion mailing list From: Linus Walleij 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 Signed-off-by: Linus Walleij --- 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,