Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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@linux-mips.org>
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>

authored by

Jamie Iles and committed by
David Woodhouse
5851becb 36cda05b

+1 -10
+1 -10
arch/mips/cavium-octeon/flash_setup.c
··· 16 16 17 17 static struct map_info flash_map; 18 18 static struct mtd_info *mymtd; 19 - #ifdef CONFIG_MTD_PARTITIONS 20 19 static int nr_parts; 21 20 static struct mtd_partition *parts; 22 21 static const char *part_probe_types[] = { ··· 25 26 #endif 26 27 NULL 27 28 }; 28 - #endif 29 29 30 30 /** 31 31 * Module/ driver initialization. ··· 61 63 if (mymtd) { 62 64 mymtd->owner = THIS_MODULE; 63 65 64 - #ifdef CONFIG_MTD_PARTITIONS 65 66 nr_parts = parse_mtd_partitions(mymtd, 66 67 part_probe_types, 67 68 &parts, 0); 68 - if (nr_parts > 0) 69 - add_mtd_partitions(mymtd, parts, nr_parts); 70 - else 71 - add_mtd_device(mymtd); 72 - #else 73 - add_mtd_device(mymtd); 74 - #endif 69 + mtd_device_register(mymtd, parts, nr_parts); 75 70 } else { 76 71 pr_err("Failed to register MTD device for flash\n"); 77 72 }