Commit 68adef5d authored by Dmitry Eremin-Solenikov's avatar Dmitry Eremin-Solenikov Committed by Artem Bityutskiy

mtd: tmio_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: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 3af55a89
......@@ -378,8 +378,6 @@ static int tmio_probe(struct platform_device *dev)
struct tmio_nand *tmio;
struct mtd_info *mtd;
struct nand_chip *nand_chip;
struct mtd_partition *parts;
int nbparts = 0;
int retval;
if (data == NULL)
......@@ -458,13 +456,9 @@ static int tmio_probe(struct platform_device *dev)
goto err_scan;
}
/* Register the partitions */
nbparts = parse_mtd_partitions(mtd, NULL, &parts, 0);
if (nbparts <= 0 && data) {
parts = data->partition;
nbparts = data->num_partitions;
}
retval = mtd_device_register(mtd, parts, nbparts);
retval = mtd_device_parse_register(mtd, NULL, 0,
data ? data->partition : NULL,
data ? data->num_partitions : 0);
if (!retval)
return retval;
......
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