mtd: tmio_nand: convert to mtd_device_register()

Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
preprocessor conditionals as partitioning is always available.

Signed-off-by: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:
Jamie Iles 2011-05-23 10:23:36 +01:00 committed by David Woodhouse
parent 5667bc8a5b
commit d1e084e663

View File

@ -381,10 +381,8 @@ static int tmio_probe(struct platform_device *dev)
struct tmio_nand *tmio; struct tmio_nand *tmio;
struct mtd_info *mtd; struct mtd_info *mtd;
struct nand_chip *nand_chip; struct nand_chip *nand_chip;
#ifdef CONFIG_MTD_PARTITIONS
struct mtd_partition *parts; struct mtd_partition *parts;
int nbparts = 0; int nbparts = 0;
#endif
int retval; int retval;
if (data == NULL) if (data == NULL)
@ -463,7 +461,6 @@ static int tmio_probe(struct platform_device *dev)
goto err_scan; goto err_scan;
} }
/* Register the partitions */ /* Register the partitions */
#ifdef CONFIG_MTD_PARTITIONS
#ifdef CONFIG_MTD_CMDLINE_PARTS #ifdef CONFIG_MTD_CMDLINE_PARTS
nbparts = parse_mtd_partitions(mtd, part_probes, &parts, 0); nbparts = parse_mtd_partitions(mtd, part_probes, &parts, 0);
#endif #endif
@ -472,12 +469,7 @@ static int tmio_probe(struct platform_device *dev)
nbparts = data->num_partitions; nbparts = data->num_partitions;
} }
if (nbparts) retval = mtd_device_register(mtd, parts, nbparts);
retval = add_mtd_partitions(mtd, parts, nbparts);
else
#endif
retval = add_mtd_device(mtd);
if (!retval) if (!retval)
return retval; return retval;