Skip to content

Commit

Permalink
mtd: intel_vr_nor.c: use mtd_device_parse_register
Browse files Browse the repository at this point in the history
Replace custom invocations of parse_mtd_partitions and mtd_device_register
with common mtd_device_parse_register call. This would bring: standard
handling of all errors, fallback to default partitions, etc.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Dmitry Eremin-Solenikov authored and Artem Bityutskiy committed Sep 11, 2011
1 parent 5003403 commit ba6bead
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/mtd/maps/intel_vr_nor.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ struct vr_nor_mtd {
void __iomem *csr_base;
struct map_info map;
struct mtd_info *info;
int nr_parts;
struct pci_dev *dev;
};

Expand All @@ -71,12 +70,9 @@ static void __devexit vr_nor_destroy_partitions(struct vr_nor_mtd *p)

static int __devinit vr_nor_init_partitions(struct vr_nor_mtd *p)
{
struct mtd_partition *parts;

/* register the flash bank */
/* partition the flash bank */
p->nr_parts = parse_mtd_partitions(p->info, NULL, &parts, 0);
return mtd_device_register(p->info, parts, p->nr_parts);
return mtd_device_parse_register(p->info, NULL, 0, NULL, 0);
}

static void __devexit vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p)
Expand Down

0 comments on commit ba6bead

Please sign in to comment.