Commit ba6bead4 authored by Dmitry Eremin-Solenikov's avatar Dmitry Eremin-Solenikov Committed by Artem Bityutskiy

mtd: intel_vr_nor.c: use mtd_device_parse_register

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: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 5003403b
...@@ -44,7 +44,6 @@ struct vr_nor_mtd { ...@@ -44,7 +44,6 @@ struct vr_nor_mtd {
void __iomem *csr_base; void __iomem *csr_base;
struct map_info map; struct map_info map;
struct mtd_info *info; struct mtd_info *info;
int nr_parts;
struct pci_dev *dev; struct pci_dev *dev;
}; };
...@@ -71,12 +70,9 @@ static void __devexit vr_nor_destroy_partitions(struct vr_nor_mtd *p) ...@@ -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) static int __devinit vr_nor_init_partitions(struct vr_nor_mtd *p)
{ {
struct mtd_partition *parts;
/* register the flash bank */ /* register the flash bank */
/* partition the flash bank */ /* partition the flash bank */
p->nr_parts = parse_mtd_partitions(p->info, NULL, &parts, 0); return mtd_device_parse_register(p->info, NULL, 0, NULL, 0);
return mtd_device_register(p->info, parts, p->nr_parts);
} }
static void __devexit vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p) static void __devexit vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p)
......
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