aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJamie Iles <jamie@jamieiles.com>2011-05-23 05:23:13 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2011-05-24 21:23:12 -0400
commite6232b42438cefc06124b1e09613d8b27f6b6f5d (patch)
treee1f585c070a6bdde0a7be8c3ef3632266947b715 /drivers
parent5e7e96866df7a9ff7733bd1660e0a3c510bf1b45 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/atmel_nand.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 380912f24ad8..b300705d41cb 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -495,11 +495,8 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
495 struct resource *regs; 495 struct resource *regs;
496 struct resource *mem; 496 struct resource *mem;
497 int res; 497 int res;
498
499#ifdef CONFIG_MTD_PARTITIONS
500 struct mtd_partition *partitions = NULL; 498 struct mtd_partition *partitions = NULL;
501 int num_partitions = 0; 499 int num_partitions = 0;
502#endif
503 500
504 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); 501 mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
505 if (!mem) { 502 if (!mem) {
@@ -657,7 +654,6 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
657 goto err_scan_tail; 654 goto err_scan_tail;
658 } 655 }
659 656
660#ifdef CONFIG_MTD_PARTITIONS
661#ifdef CONFIG_MTD_CMDLINE_PARTS 657#ifdef CONFIG_MTD_CMDLINE_PARTS
662 mtd->name = "atmel_nand"; 658 mtd->name = "atmel_nand";
663 num_partitions = parse_mtd_partitions(mtd, part_probes, 659 num_partitions = parse_mtd_partitions(mtd, part_probes,
@@ -673,17 +669,11 @@ static int __init atmel_nand_probe(struct platform_device *pdev)
673 goto err_no_partitions; 669 goto err_no_partitions;
674 } 670 }
675 671
676 res = add_mtd_partitions(mtd, partitions, num_partitions); 672 res = mtd_device_register(mtd, partitions, num_partitions);
677#else
678 res = add_mtd_device(mtd);
679#endif
680
681 if (!res) 673 if (!res)
682 return res; 674 return res;
683 675
684#ifdef CONFIG_MTD_PARTITIONS
685err_no_partitions: 676err_no_partitions:
686#endif
687 nand_release(mtd); 677 nand_release(mtd);
688err_scan_tail: 678err_scan_tail:
689err_scan_ident: 679err_scan_ident: