Commit a17f7ca5 authored by Jamie Iles's avatar Jamie Iles Committed by David Woodhouse

mtd: cs553x_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: 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 46720bbf
...@@ -277,22 +277,15 @@ static int is_geode(void) ...@@ -277,22 +277,15 @@ static int is_geode(void)
return 0; return 0;
} }
#ifdef CONFIG_MTD_PARTITIONS
static const char *part_probes[] = { "cmdlinepart", NULL }; static const char *part_probes[] = { "cmdlinepart", NULL };
#endif
static int __init cs553x_init(void) static int __init cs553x_init(void)
{ {
int err = -ENXIO; int err = -ENXIO;
int i; int i;
uint64_t val; uint64_t val;
#ifdef CONFIG_MTD_PARTITIONS
int mtd_parts_nb = 0; int mtd_parts_nb = 0;
struct mtd_partition *mtd_parts = NULL; struct mtd_partition *mtd_parts = NULL;
#endif
/* If the CPU isn't a Geode GX or LX, abort */ /* If the CPU isn't a Geode GX or LX, abort */
if (!is_geode()) if (!is_geode())
...@@ -324,17 +317,11 @@ static int __init cs553x_init(void) ...@@ -324,17 +317,11 @@ static int __init cs553x_init(void)
if (cs553x_mtd[i]) { if (cs553x_mtd[i]) {
/* If any devices registered, return success. Else the last error. */ /* If any devices registered, return success. Else the last error. */
#ifdef CONFIG_MTD_PARTITIONS
mtd_parts_nb = parse_mtd_partitions(cs553x_mtd[i], part_probes, &mtd_parts, 0); mtd_parts_nb = parse_mtd_partitions(cs553x_mtd[i], part_probes, &mtd_parts, 0);
if (mtd_parts_nb > 0) { if (mtd_parts_nb > 0)
printk(KERN_NOTICE "Using command line partition definition\n"); printk(KERN_NOTICE "Using command line partition definition\n");
add_mtd_partitions(cs553x_mtd[i], mtd_parts, mtd_parts_nb); mtd_device_register(cs553x_mtd[i], mtd_parts,
} else { mtd_parts_nb);
add_mtd_device(cs553x_mtd[i]);
}
#else
add_mtd_device(cs553x_mtd[i]);
#endif
err = 0; err = 0;
} }
} }
......
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