Skip to content

Commit

Permalink
mtd: tmio_nand: convert to mtd_device_register()
Browse files Browse the repository at this point in the history
Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.

Signed-off-by: Jamie Iles <[email protected]>
Signed-off-by: Artem Bityutskiy <[email protected]>
Signed-off-by: David Woodhouse <[email protected]>
  • Loading branch information
jamieiles authored and David Woodhouse committed May 25, 2011
1 parent 5667bc8 commit d1e084e
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions drivers/mtd/nand/tmio_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,8 @@ static int tmio_probe(struct platform_device *dev)
struct tmio_nand *tmio;
struct mtd_info *mtd;
struct nand_chip *nand_chip;
#ifdef CONFIG_MTD_PARTITIONS
struct mtd_partition *parts;
int nbparts = 0;
#endif
int retval;

if (data == NULL)
Expand Down Expand Up @@ -463,7 +461,6 @@ static int tmio_probe(struct platform_device *dev)
goto err_scan;
}
/* Register the partitions */
#ifdef CONFIG_MTD_PARTITIONS
#ifdef CONFIG_MTD_CMDLINE_PARTS
nbparts = parse_mtd_partitions(mtd, part_probes, &parts, 0);
#endif
Expand All @@ -472,12 +469,7 @@ static int tmio_probe(struct platform_device *dev)
nbparts = data->num_partitions;
}

if (nbparts)
retval = add_mtd_partitions(mtd, parts, nbparts);
else
#endif
retval = add_mtd_device(mtd);

retval = mtd_device_register(mtd, parts, nbparts);
if (!retval)
return retval;

Expand Down

0 comments on commit d1e084e

Please sign in to comment.