Commit 92ffb00d authored by Dmitry Eremin-Solenikov's avatar Dmitry Eremin-Solenikov Committed by Artem Bityutskiy

mtd: onenand/generic.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: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 9e58c5d4
...@@ -32,7 +32,6 @@ ...@@ -32,7 +32,6 @@
struct onenand_info { struct onenand_info {
struct mtd_info mtd; struct mtd_info mtd;
struct mtd_partition *parts;
struct onenand_chip onenand; struct onenand_chip onenand;
}; };
...@@ -71,13 +70,9 @@ static int __devinit generic_onenand_probe(struct platform_device *pdev) ...@@ -71,13 +70,9 @@ static int __devinit generic_onenand_probe(struct platform_device *pdev)
goto out_iounmap; goto out_iounmap;
} }
err = parse_mtd_partitions(&info->mtd, NULL, &info->parts, 0); err = mtd_device_parse_register(&info->mtd, NULL, 0,
if (err > 0) pdata ? pdata->parts : NULL,
mtd_device_register(&info->mtd, info->parts, err); pdata ? pdata->nr_parts : 0);
else if (err <= 0 && pdata && pdata->parts)
mtd_device_register(&info->mtd, pdata->parts, pdata->nr_parts);
else
err = mtd_device_register(&info->mtd, NULL, 0);
platform_set_drvdata(pdev, info); platform_set_drvdata(pdev, info);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment