mtd: atmel_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:13 +01:00 committed by David Woodhouse
parent 5e7e96866d
commit e6232b4243

View File

@ -495,11 +495,8 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
struct resource *regs; struct resource *regs;
struct resource *mem; struct resource *mem;
int res; int res;
#ifdef CONFIG_MTD_PARTITIONS
struct mtd_partition *partitions = NULL; struct mtd_partition *partitions = NULL;
int num_partitions = 0; int num_partitions = 0;
#endif
mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!mem) { if (!mem) {
@ -657,7 +654,6 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
goto err_scan_tail; goto err_scan_tail;
} }
#ifdef CONFIG_MTD_PARTITIONS
#ifdef CONFIG_MTD_CMDLINE_PARTS #ifdef CONFIG_MTD_CMDLINE_PARTS
mtd->name = "atmel_nand"; mtd->name = "atmel_nand";
num_partitions = parse_mtd_partitions(mtd, part_probes, num_partitions = parse_mtd_partitions(mtd, part_probes,
@ -673,17 +669,11 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
goto err_no_partitions; goto err_no_partitions;
} }
res = add_mtd_partitions(mtd, partitions, num_partitions); res = mtd_device_register(mtd, partitions, num_partitions);
#else
res = add_mtd_device(mtd);
#endif
if (!res) if (!res)
return res; return res;
#ifdef CONFIG_MTD_PARTITIONS
err_no_partitions: err_no_partitions:
#endif
nand_release(mtd); nand_release(mtd);
err_scan_tail: err_scan_tail:
err_scan_ident: err_scan_ident: