mtd: octeon: convert to mtd_device_register()

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue May 24 21:59:09 EDT 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=5851becb5bae13ca6525fd0d97116043fcb0e20e
Commit:     5851becb5bae13ca6525fd0d97116043fcb0e20e
Parent:     36cda05b375ad0fbaba3879047b62d270d214376
Author:     Jamie Iles <jamie at jamieiles.com>
AuthorDate: Mon May 23 10:22:54 2011 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Wed May 25 02:21:11 2011 +0100

    mtd: octeon: convert to mtd_device_register()
    
    Convert to mtd_device_register() and remove the CONFIG_MTD_PARTITIONS
    preprocessor conditionals as partitioning is always available.
    
    Cc: Ralf Baechle <ralf at linux-mips.org>
    Signed-off-by: Jamie Iles <jamie at jamieiles.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 arch/mips/cavium-octeon/flash_setup.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/arch/mips/cavium-octeon/flash_setup.c b/arch/mips/cavium-octeon/flash_setup.c
index 008f657..0ee02f5 100644
--- a/arch/mips/cavium-octeon/flash_setup.c
+++ b/arch/mips/cavium-octeon/flash_setup.c
@@ -16,7 +16,6 @@
 
 static struct map_info flash_map;
 static struct mtd_info *mymtd;
-#ifdef CONFIG_MTD_PARTITIONS
 static int nr_parts;
 static struct mtd_partition *parts;
 static const char *part_probe_types[] = {
@@ -26,7 +25,6 @@ static const char *part_probe_types[] = {
 #endif
 	NULL
 };
-#endif
 
 /**
  * Module/ driver initialization.
@@ -63,17 +61,10 @@ static int __init flash_init(void)
 		if (mymtd) {
 			mymtd->owner = THIS_MODULE;
 
-#ifdef CONFIG_MTD_PARTITIONS
 			nr_parts = parse_mtd_partitions(mymtd,
 							part_probe_types,
 							&parts, 0);
-			if (nr_parts > 0)
-				add_mtd_partitions(mymtd, parts, nr_parts);
-			else
-				add_mtd_device(mymtd);
-#else
-			add_mtd_device(mymtd);
-#endif
+			mtd_device_register(mymtd, parts, nr_parts);
 		} else {
 			pr_err("Failed to register MTD device for flash\n");
 		}



More information about the linux-mtd-cvs mailing list