diff options
author | Jamie Iles <jamie@jamieiles.com> | 2011-05-23 05:23:05 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2011-05-24 21:21:51 -0400 |
commit | 95bf224f6c26e5dc4f411f95bb2efa5487ed57bd (patch) | |
tree | 680fe7317d364817ba85c16f2b556b0d541e0398 /drivers | |
parent | 96b639fd5319986fc21f9d99a78cae97d099bc4c (diff) |
mtd: intel_vr_nor: 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: Jamie Iles <jamie@jamieiles.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mtd/maps/intel_vr_nor.c | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/drivers/mtd/maps/intel_vr_nor.c b/drivers/mtd/maps/intel_vr_nor.c index fc1998512eb4..d2f47be8754b 100644 --- a/drivers/mtd/maps/intel_vr_nor.c +++ b/drivers/mtd/maps/intel_vr_nor.c | |||
@@ -66,33 +66,18 @@ struct vr_nor_mtd { | |||
66 | 66 | ||
67 | static void __devexit vr_nor_destroy_partitions(struct vr_nor_mtd *p) | 67 | static void __devexit vr_nor_destroy_partitions(struct vr_nor_mtd *p) |
68 | { | 68 | { |
69 | if (p->nr_parts > 0) { | 69 | mtd_device_unregister(p->info); |
70 | #if defined(CONFIG_MTD_PARTITIONS) || defined(CONFIG_MTD_PARTITIONS_MODULE) | ||
71 | del_mtd_partitions(p->info); | ||
72 | #endif | ||
73 | } else | ||
74 | del_mtd_device(p->info); | ||
75 | } | 70 | } |
76 | 71 | ||
77 | static int __devinit vr_nor_init_partitions(struct vr_nor_mtd *p) | 72 | static int __devinit vr_nor_init_partitions(struct vr_nor_mtd *p) |
78 | { | 73 | { |
79 | int err = 0; | ||
80 | #if defined(CONFIG_MTD_PARTITIONS) || defined(CONFIG_MTD_PARTITIONS_MODULE) | ||
81 | struct mtd_partition *parts; | 74 | struct mtd_partition *parts; |
82 | static const char *part_probes[] = { "cmdlinepart", NULL }; | 75 | static const char *part_probes[] = { "cmdlinepart", NULL }; |
83 | #endif | ||
84 | 76 | ||
85 | /* register the flash bank */ | 77 | /* register the flash bank */ |
86 | #if defined(CONFIG_MTD_PARTITIONS) || defined(CONFIG_MTD_PARTITIONS_MODULE) | ||
87 | /* partition the flash bank */ | 78 | /* partition the flash bank */ |
88 | p->nr_parts = parse_mtd_partitions(p->info, part_probes, &parts, 0); | 79 | p->nr_parts = parse_mtd_partitions(p->info, part_probes, &parts, 0); |
89 | if (p->nr_parts > 0) | 80 | return mtd_device_register(p->info, parts, p->nr_parts); |
90 | err = add_mtd_partitions(p->info, parts, p->nr_parts); | ||
91 | #endif | ||
92 | if (p->nr_parts <= 0) | ||
93 | err = add_mtd_device(p->info); | ||
94 | |||
95 | return err; | ||
96 | } | 81 | } |
97 | 82 | ||
98 | static void __devexit vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p) | 83 | static void __devexit vr_nor_destroy_mtd_setup(struct vr_nor_mtd *p) |