]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mtd: orion_nand.c: use mtd_device_parse_register
authorDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Thu, 2 Jun 2011 14:00:55 +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/orion_nand.c

index 5c55981df3da6b477b7dcd87a1facdae75757368..29f505adaf8411581fcbb8d78d09935bef07f36d 100644 (file)
@@ -79,8 +79,6 @@ static int __init orion_nand_probe(struct platform_device *pdev)
        struct resource *res;
        void __iomem *io_base;
        int ret = 0;
-       struct mtd_partition *partitions = NULL;
-       int num_part = 0;
 
        nc = kzalloc(sizeof(struct nand_chip) + sizeof(struct mtd_info), GFP_KERNEL);
        if (!nc) {
@@ -131,14 +129,8 @@ static int __init orion_nand_probe(struct platform_device *pdev)
        }
 
        mtd->name = "orion_nand";
-       num_part = parse_mtd_partitions(mtd, NULL, &partitions, 0);
-       /* If cmdline partitions have been passed, let them be used */
-       if (num_part <= 0) {
-               num_part = board->nr_parts;
-               partitions = board->parts;
-       }
-
-       ret = mtd_device_register(mtd, partitions, num_part);
+       ret = mtd_device_parse_register(mtd, NULL, 0,
+                       board->parts, board->nr_parts);
        if (ret) {
                nand_release(mtd);
                goto no_dev;