aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/nand/mxc_nand.c
diff options
context:
space:
mode:
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>2011-06-02 10:00:43 -0400
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 08:02:09 -0400
commitd4ed8f1222d5ada9da402cf312dc64e39c705da9 (patch)
treeecdaf8911b867d33549cce4cae5e1d70e65331bb /drivers/mtd/nand/mxc_nand.c
parent90ee1fb3ac918362402a06d0f71545111f374980 (diff)
mtd: mxc_nand.c: use mtd_device_parse_register
Replace custom invocations of parse_mtd_partitions and mtd_device_register with common mtd_device_parse_register call. This would bring: standard handling of all errors, fallback to default partitions, etc. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/mtd/nand/mxc_nand.c')
-rw-r--r--drivers/mtd/nand/mxc_nand.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
index ca42c8f335b3..4c2bb4a4bf0b 100644
--- a/drivers/mtd/nand/mxc_nand.c
+++ b/drivers/mtd/nand/mxc_nand.c
@@ -143,7 +143,6 @@
143struct mxc_nand_host { 143struct mxc_nand_host {
144 struct mtd_info mtd; 144 struct mtd_info mtd;
145 struct nand_chip nand; 145 struct nand_chip nand;
146 struct mtd_partition *parts;
147 struct device *dev; 146 struct device *dev;
148 147
149 void *spare0; 148 void *spare0;
@@ -1044,7 +1043,7 @@ static int __init mxcnd_probe(struct platform_device *pdev)
1044 struct mxc_nand_platform_data *pdata = pdev->dev.platform_data; 1043 struct mxc_nand_platform_data *pdata = pdev->dev.platform_data;
1045 struct mxc_nand_host *host; 1044 struct mxc_nand_host *host;
1046 struct resource *res; 1045 struct resource *res;
1047 int err = 0, __maybe_unused nr_parts = 0; 1046 int err = 0;
1048 struct nand_ecclayout *oob_smallpage, *oob_largepage; 1047 struct nand_ecclayout *oob_smallpage, *oob_largepage;
1049 1048
1050 /* Allocate memory for MTD device structure and private data */ 1049 /* Allocate memory for MTD device structure and private data */
@@ -1231,16 +1230,8 @@ static int __init mxcnd_probe(struct platform_device *pdev)
1231 } 1230 }
1232 1231
1233 /* Register the partitions */ 1232 /* Register the partitions */
1234 nr_parts = 1233 mtd_device_parse_register(mtd, part_probes, 0,
1235 parse_mtd_partitions(mtd, part_probes, &host->parts, 0); 1234 pdata->parts, pdata->nr_parts);
1236 if (nr_parts > 0)
1237 mtd_device_register(mtd, host->parts, nr_parts);
1238 else if (pdata->parts)
1239 mtd_device_register(mtd, pdata->parts, pdata->nr_parts);
1240 else {
1241 pr_info("Registering %s as whole device\n", mtd->name);
1242 mtd_device_register(mtd, NULL, 0);
1243 }
1244 1235
1245 platform_set_drvdata(pdev, host); 1236 platform_set_drvdata(pdev, host);
1246 1237