Skip to content

Commit

Permalink
mtd: h720x-flash: 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.

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 fdbf3bf commit 360e40a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mtd/maps/h720x-flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,16 @@ static int __init h720x_mtd_init(void)
if (mymtd) {
mymtd->owner = THIS_MODULE;

#ifdef CONFIG_MTD_PARTITIONS
nr_mtd_parts = parse_mtd_partitions(mymtd, probes, &mtd_parts, 0);
if (nr_mtd_parts > 0)
part_type = "command line";
#endif
if (nr_mtd_parts <= 0) {
mtd_parts = h720x_partitions;
nr_mtd_parts = NUM_PARTITIONS;
part_type = "builtin";
}
printk(KERN_INFO "Using %s partition table\n", part_type);
add_mtd_partitions(mymtd, mtd_parts, nr_mtd_parts);
mtd_device_register(mymtd, mtd_parts, nr_mtd_parts);
return 0;
}

Expand All @@ -118,7 +116,7 @@ static void __exit h720x_mtd_cleanup(void)
{

if (mymtd) {
del_mtd_partitions(mymtd);
mtd_device_unregister(mymtd);
map_destroy(mymtd);
}

Expand Down

0 comments on commit 360e40a

Please sign in to comment.