Skip to content

Commit

Permalink
mtd: omap2.c: use mtd_device_parse_register
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Eremin-Solenikov authored and Artem Bityutskiy committed Sep 11, 2011
1 parent d4ed8f1 commit 69c85f1
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions drivers/mtd/nand/omap2.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ struct omap_nand_info {
struct nand_hw_control controller;
struct omap_nand_platform_data *pdata;
struct mtd_info mtd;
struct mtd_partition *parts;
struct nand_chip nand;
struct platform_device *pdev;

Expand Down Expand Up @@ -1101,13 +1100,8 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
goto out_release_mem_region;
}

err = parse_mtd_partitions(&info->mtd, NULL, &info->parts, 0);
if (err > 0)
mtd_device_register(&info->mtd, info->parts, err);
else if (pdata->parts)
mtd_device_register(&info->mtd, pdata->parts, pdata->nr_parts);
else
mtd_device_register(&info->mtd, NULL, 0);
mtd_device_parse_register(&info->mtd, NULL, 0,
pdata->parts, pdata->nr_parts);

platform_set_drvdata(pdev, &info->mtd);

Expand Down

0 comments on commit 69c85f1

Please sign in to comment.