mtd: pxa3xx_nand.c: use mtd_device_parse_register
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Thu, 2 Jun 2011 14:00:59 +0000 (18:00 +0400)
committerArtem Bityutskiy <artem.bityutskiy@intel.com>
Sun, 11 Sep 2011 12:02:09 +0000 (15:02 +0300)
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>
drivers/mtd/nand/pxa3xx_nand.c

index 5c3af2f72a62ccca6bddc86fa244cef0b1392e97..b7db1b2021f21ecd72eeb6c10538df755f14ce11 100644 (file)
@@ -1133,8 +1133,6 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
 {
        struct pxa3xx_nand_platform_data *pdata;
        struct pxa3xx_nand_info *info;
-       struct mtd_partition *parts;
-       int nr_parts;
 
        pdata = pdev->dev.platform_data;
        if (!pdata) {
@@ -1152,13 +1150,8 @@ static int pxa3xx_nand_probe(struct platform_device *pdev)
                return -ENODEV;
        }
 
-
-       nr_parts = parse_mtd_partitions(info->mtd, NULL, &parts, 0);
-
-       if (nr_parts)
-               return mtd_device_register(info->mtd, parts, nr_parts);
-
-       return mtd_device_register(info->mtd, pdata->parts, pdata->nr_parts);
+       return mtd_device_parse_register(info->mtd, NULL, 0,
+                       pdata->parts, pdata->nr_parts);
 }
 
 #ifdef CONFIG_PM