summaryrefslogtreecommitdiff
path: root/drivers/mtd
diff options
context:
space:
mode:
authorMurali Karicheri <m-karicheri2@ti.com>2012-11-02 18:22:41 +0400
committerArtem Bityutskiy <Artem.Bityutskiy@linux.intel.com>2012-11-15 21:50:30 +0400
commit192afdbfbc5c3346e27b3c3e3be8337495b2a41b (patch)
tree3fba2b0dc131373680a809557f68a9c7f7e62547 /drivers/mtd
parent6f9f59ee2e254a7e997985d8eb708930da49245a (diff)
downloadlinux-192afdbfbc5c3346e27b3c3e3be8337495b2a41b.tar.xz
mtd: davinci: add support for parition binding nodes
Enhance the driver to support partition subnodes inside the nand device bindings to describe partions on the nand device. Signed-off-by: Murali Karicheri <m-karicheri2@ti.com> Reviewed-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/nand/davinci_nand.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/mtd/nand/davinci_nand.c b/drivers/mtd/nand/davinci_nand.c
index 945047ad0952..3502606f6480 100644
--- a/drivers/mtd/nand/davinci_nand.c
+++ b/drivers/mtd/nand/davinci_nand.c
@@ -821,9 +821,16 @@ syndrome_done:
if (ret < 0)
goto err_scan;
- ret = mtd_device_parse_register(&info->mtd, NULL, NULL, pdata->parts,
- pdata->nr_parts);
-
+ if (pdata->parts)
+ ret = mtd_device_parse_register(&info->mtd, NULL, NULL,
+ pdata->parts, pdata->nr_parts);
+ else {
+ struct mtd_part_parser_data ppdata;
+
+ ppdata.of_node = pdev->dev.of_node;
+ ret = mtd_device_parse_register(&info->mtd, NULL, &ppdata,
+ NULL, 0);
+ }
if (ret < 0)
goto err_scan;