Skip to content

Commit

Permalink
mtd: octeon: convert to mtd_device_register()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jamie Iles authored and David Woodhouse committed May 25, 2011
1 parent 36cda05 commit 5851bec
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions arch/mips/cavium-octeon/flash_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand All @@ -26,7 +25,6 @@ static const char *part_probe_types[] = {
#endif
NULL
};
#endif

/**
* Module/ driver initialization.
Expand Down Expand Up @@ -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");
}
Expand Down

0 comments on commit 5851bec

Please sign in to comment.