Commit 5851becb authored by Jamie Iles's avatar Jamie Iles Committed by David Woodhouse

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: default avatarJamie Iles <jamie@jamieiles.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 36cda05b
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
static struct map_info flash_map; static struct map_info flash_map;
static struct mtd_info *mymtd; static struct mtd_info *mymtd;
#ifdef CONFIG_MTD_PARTITIONS
static int nr_parts; static int nr_parts;
static struct mtd_partition *parts; static struct mtd_partition *parts;
static const char *part_probe_types[] = { static const char *part_probe_types[] = {
...@@ -26,7 +25,6 @@ static const char *part_probe_types[] = { ...@@ -26,7 +25,6 @@ static const char *part_probe_types[] = {
#endif #endif
NULL NULL
}; };
#endif
/** /**
* Module/ driver initialization. * Module/ driver initialization.
...@@ -63,17 +61,10 @@ static int __init flash_init(void) ...@@ -63,17 +61,10 @@ static int __init flash_init(void)
if (mymtd) { if (mymtd) {
mymtd->owner = THIS_MODULE; mymtd->owner = THIS_MODULE;
#ifdef CONFIG_MTD_PARTITIONS
nr_parts = parse_mtd_partitions(mymtd, nr_parts = parse_mtd_partitions(mymtd,
part_probe_types, part_probe_types,
&parts, 0); &parts, 0);
if (nr_parts > 0) mtd_device_register(mymtd, parts, nr_parts);
add_mtd_partitions(mymtd, parts, nr_parts);
else
add_mtd_device(mymtd);
#else
add_mtd_device(mymtd);
#endif
} else { } else {
pr_err("Failed to register MTD device for flash\n"); pr_err("Failed to register MTD device for flash\n");
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment