Skip to content

Commit

Permalink
mtd: tmio_nand.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 3af55a8 commit 68adef5
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/mtd/nand/tmio_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 68adef5

Please sign in to comment.