aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorVipin Kumar <vipin.kumar@st.com>2012-03-14 02:17:07 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-03-26 19:57:32 -0400
commit7147032485293fc24751e4dede98ff29050fd3bd (patch)
treee30673a813330a3f115d9ae6feb40a60a14d466d /drivers
parentb2a2a84d35e0f42ad26e326ec4258f6a8b8eecbe (diff)
mtd: nand/fsmc: Pass partition information through platform data
This patch reimplements the passing of partition information through platform data. This was unintentionally deleted in commit 0d04eda1430e9a796214bee644b7e05d99cfe613 "mtd: fsmc_nand.c: use mtd_device_parse_register" Artem: fix gcc warning about passin 0 instead of NULL. Signed-off-by: Vipin Kumar <vipin.kumar@st.com> Acked-by: Stefan Roese <sr@denx.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Cc: stable@kernel.org [3.2+] Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/fsmc_nand.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/mtd/nand/fsmc_nand.c b/drivers/mtd/nand/fsmc_nand.c
index 588e3733c3a4..7338d33fe1ed 100644
--- a/drivers/mtd/nand/fsmc_nand.c
+++ b/drivers/mtd/nand/fsmc_nand.c
@@ -333,6 +333,8 @@ static struct mtd_partition partition_info_128KB_blk[] = {
333 * @pid: Part ID on the AMBA PrimeCell format 333 * @pid: Part ID on the AMBA PrimeCell format
334 * @mtd: MTD info for a NAND flash. 334 * @mtd: MTD info for a NAND flash.
335 * @nand: Chip related info for a NAND flash. 335 * @nand: Chip related info for a NAND flash.
336 * @partitions: Partition info for a NAND Flash.
337 * @nr_partitions: Total number of partition of a NAND flash.
336 * 338 *
337 * @ecc_place: ECC placing locations in oobfree type format. 339 * @ecc_place: ECC placing locations in oobfree type format.
338 * @bank: Bank number for probed device. 340 * @bank: Bank number for probed device.
@@ -347,6 +349,8 @@ struct fsmc_nand_data {
347 u32 pid; 349 u32 pid;
348 struct mtd_info mtd; 350 struct mtd_info mtd;
349 struct nand_chip nand; 351 struct nand_chip nand;
352 struct mtd_partition *partitions;
353 unsigned int nr_partitions;
350 354
351 struct fsmc_eccplace *ecc_place; 355 struct fsmc_eccplace *ecc_place;
352 unsigned int bank; 356 unsigned int bank;
@@ -833,6 +837,8 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
833 837
834 host->bank = pdata->bank; 838 host->bank = pdata->bank;
835 host->select_chip = pdata->select_bank; 839 host->select_chip = pdata->select_bank;
840 host->partitions = pdata->partitions;
841 host->nr_partitions = pdata->nr_partitions;
836 regs = host->regs_va; 842 regs = host->regs_va;
837 843
838 /* Link all private pointers */ 844 /* Link all private pointers */
@@ -943,12 +949,7 @@ static int __init fsmc_nand_probe(struct platform_device *pdev)
943 */ 949 */
944 host->mtd.name = "nand"; 950 host->mtd.name = "nand";
945 ret = mtd_device_parse_register(&host->mtd, NULL, NULL, 951 ret = mtd_device_parse_register(&host->mtd, NULL, NULL,
946 host->mtd.size <= 0x04000000 ? 952 host->partitions, host->nr_partitions);
947 partition_info_16KB_blk :
948 partition_info_128KB_blk,
949 host->mtd.size <= 0x04000000 ?
950 ARRAY_SIZE(partition_info_16KB_blk) :
951 ARRAY_SIZE(partition_info_128KB_blk));
952 if (ret) 953 if (ret)
953 goto err_probe; 954 goto err_probe;
954 955