diff options
author | Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> | 2011-05-29 17:02:25 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-09-11 08:02:11 -0400 |
commit | 9d7948c50055e74b693ce9e99a709b2e5bbc1942 (patch) | |
tree | f6258e3a4f4c06b93a675f8f23d4eb1a2102e86f /drivers/mtd/nand/ndfc.c | |
parent | b3702ea4915363102870a6af60d06d655ca4a09d (diff) |
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@gmail.com>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
Diffstat (limited to 'drivers/mtd/nand/ndfc.c')
-rw-r--r-- | 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 70c04ffa573c..1528734b7616 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, | |||
161 | { | 161 | { |
162 | struct device_node *flash_np; | 162 | struct device_node *flash_np; |
163 | struct nand_chip *chip = &ndfc->chip; | 163 | struct nand_chip *chip = &ndfc->chip; |
164 | struct mtd_part_parser_data ppdata; | ||
164 | int ret; | 165 | int ret; |
165 | 166 | ||
166 | chip->IO_ADDR_R = ndfc->ndfcbase + NDFC_DATA; | 167 | chip->IO_ADDR_R = ndfc->ndfcbase + NDFC_DATA; |
@@ -188,6 +189,7 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc, | |||
188 | if (!flash_np) | 189 | if (!flash_np) |
189 | return -ENODEV; | 190 | return -ENODEV; |
190 | 191 | ||
192 | ppdata->of_node = flash_np; | ||
191 | ndfc->mtd.name = kasprintf(GFP_KERNEL, "%s.%s", | 193 | ndfc->mtd.name = kasprintf(GFP_KERNEL, "%s.%s", |
192 | dev_name(&ndfc->ofdev->dev), flash_np->name); | 194 | dev_name(&ndfc->ofdev->dev), flash_np->name); |
193 | if (!ndfc->mtd.name) { | 195 | if (!ndfc->mtd.name) { |
@@ -199,17 +201,10 @@ static int ndfc_chip_init(struct ndfc_controller *ndfc, | |||
199 | if (ret) | 201 | if (ret) |
200 | goto err; | 202 | goto err; |
201 | 203 | ||
202 | ret = parse_mtd_partitions(&ndfc->mtd, NULL, &ndfc->parts, 0); | 204 | ret = parse_mtd_partitions(&ndfc->mtd, NULL, &ndfc->parts, &ppdata); |
203 | if (ret < 0) | 205 | if (ret < 0) |
204 | goto err; | 206 | goto err; |
205 | 207 | ||
206 | if (ret == 0) { | ||
207 | ret = of_mtd_parse_partitions(&ndfc->ofdev->dev, flash_np, | ||
208 | &ndfc->parts); | ||
209 | if (ret < 0) | ||
210 | goto err; | ||
211 | } | ||
212 | |||
213 | ret = mtd_device_register(&ndfc->mtd, ndfc->parts, ret); | 208 | ret = mtd_device_register(&ndfc->mtd, ndfc->parts, ret); |
214 | 209 | ||
215 | err: | 210 | err: |