mtd: ndfc: use ofpart through generic parsing
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Mon Nov 7 11:59:21 EST 2011
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=9d7948c50055e74b693ce9e99a709b2e5bbc1942
Commit: 9d7948c50055e74b693ce9e99a709b2e5bbc1942
Parent: b3702ea4915363102870a6af60d06d655ca4a09d
Author: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
AuthorDate: Mon May 30 01:02:25 2011 +0400
Committer: Artem Bityutskiy <artem.bityutskiy at intel.com>
CommitDate: Sun Sep 11 15:02:11 2011 +0300
mtd: ndfc: use ofpart through generic parsing
Convert the driver to use ofpart partitions parsing through the generic
parse_mtd_partitions().
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov at gmail.com>
Signed-off-by: Artem Bityutskiy <dedekind1 at gmail.com>
---
drivers/mtd/nand/ndfc.c | 11 +++--------
1 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/mtd/nand/ndfc.c b/drivers/mtd/nand/ndfc.c
index 70c04ff..1528734 100644
--- a/drivers/mtd/nand/ndfc.c
+++ b/drivers/mtd/nand/ndfc.c
@@ -161,6 +161,7 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc,
{
struct device_node *flash_np;
struct nand_chip *chip = &ndfc->chip;
+ struct mtd_part_parser_data ppdata;
int ret;
chip->IO_ADDR_R = ndfc->ndfcbase + NDFC_DATA;
@@ -188,6 +189,7 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc,
if (!flash_np)
return -ENODEV;
+ ppdata->of_node = flash_np;
ndfc->mtd.name = kasprintf(GFP_KERNEL, "%s.%s",
dev_name(&ndfc->ofdev->dev), flash_np->name);
if (!ndfc->mtd.name) {
@@ -199,17 +201,10 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc,
if (ret)
goto err;
- ret = parse_mtd_partitions(&ndfc->mtd, NULL, &ndfc->parts, 0);
+ ret = parse_mtd_partitions(&ndfc->mtd, NULL, &ndfc->parts, &ppdata);
if (ret < 0)
goto err;
- if (ret == 0) {
- ret = of_mtd_parse_partitions(&ndfc->ofdev->dev, flash_np,
- &ndfc->parts);
- if (ret < 0)
- goto err;
- }
-
ret = mtd_device_register(&ndfc->mtd, ndfc->parts, ret);
err:
More information about the linux-mtd-cvs
mailing list