diff options
Diffstat (limited to 'drivers/mtd/maps/impa7.c')
-rw-r--r-- | drivers/mtd/maps/impa7.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c index 998a27da97f3..404a50cbafa0 100644 --- a/drivers/mtd/maps/impa7.c +++ b/drivers/mtd/maps/impa7.c | |||
@@ -15,10 +15,7 @@ | |||
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <linux/mtd/mtd.h> | 16 | #include <linux/mtd/mtd.h> |
17 | #include <linux/mtd/map.h> | 17 | #include <linux/mtd/map.h> |
18 | |||
19 | #ifdef CONFIG_MTD_PARTITIONS | ||
20 | #include <linux/mtd/partitions.h> | 18 | #include <linux/mtd/partitions.h> |
21 | #endif | ||
22 | 19 | ||
23 | #define WINDOW_ADDR0 0x00000000 /* physical properties of flash */ | 20 | #define WINDOW_ADDR0 0x00000000 /* physical properties of flash */ |
24 | #define WINDOW_SIZE0 0x00800000 | 21 | #define WINDOW_SIZE0 0x00800000 |
@@ -49,8 +46,6 @@ static struct map_info impa7_map[NUM_FLASHBANKS] = { | |||
49 | }, | 46 | }, |
50 | }; | 47 | }; |
51 | 48 | ||
52 | #ifdef CONFIG_MTD_PARTITIONS | ||
53 | |||
54 | /* | 49 | /* |
55 | * MTD partitioning stuff | 50 | * MTD partitioning stuff |
56 | */ | 51 | */ |
@@ -66,8 +61,6 @@ static struct mtd_partition static_partitions[] = | |||
66 | static int mtd_parts_nb[NUM_FLASHBANKS]; | 61 | static int mtd_parts_nb[NUM_FLASHBANKS]; |
67 | static struct mtd_partition *mtd_parts[NUM_FLASHBANKS]; | 62 | static struct mtd_partition *mtd_parts[NUM_FLASHBANKS]; |
68 | 63 | ||
69 | #endif | ||
70 | |||
71 | static const char *probes[] = { "cmdlinepart", NULL }; | 64 | static const char *probes[] = { "cmdlinepart", NULL }; |
72 | 65 | ||
73 | static int __init init_impa7(void) | 66 | static int __init init_impa7(void) |
@@ -104,7 +97,6 @@ static int __init init_impa7(void) | |||
104 | if (impa7_mtd[i]) { | 97 | if (impa7_mtd[i]) { |
105 | impa7_mtd[i]->owner = THIS_MODULE; | 98 | impa7_mtd[i]->owner = THIS_MODULE; |
106 | devicesfound++; | 99 | devicesfound++; |
107 | #ifdef CONFIG_MTD_PARTITIONS | ||
108 | mtd_parts_nb[i] = parse_mtd_partitions(impa7_mtd[i], | 100 | mtd_parts_nb[i] = parse_mtd_partitions(impa7_mtd[i], |
109 | probes, | 101 | probes, |
110 | &mtd_parts[i], | 102 | &mtd_parts[i], |
@@ -120,12 +112,8 @@ static int __init init_impa7(void) | |||
120 | printk(KERN_NOTICE MSG_PREFIX | 112 | printk(KERN_NOTICE MSG_PREFIX |
121 | "using %s partition definition\n", | 113 | "using %s partition definition\n", |
122 | part_type); | 114 | part_type); |
123 | add_mtd_partitions(impa7_mtd[i], | 115 | mtd_device_register(impa7_mtd[i], |
124 | mtd_parts[i], mtd_parts_nb[i]); | 116 | mtd_parts[i], mtd_parts_nb[i]); |
125 | #else | ||
126 | add_mtd_device(impa7_mtd[i]); | ||
127 | |||
128 | #endif | ||
129 | } | 117 | } |
130 | else | 118 | else |
131 | iounmap((void *)impa7_map[i].virt); | 119 | iounmap((void *)impa7_map[i].virt); |
@@ -138,11 +126,7 @@ static void __exit cleanup_impa7(void) | |||
138 | int i; | 126 | int i; |
139 | for (i=0; i<NUM_FLASHBANKS; i++) { | 127 | for (i=0; i<NUM_FLASHBANKS; i++) { |
140 | if (impa7_mtd[i]) { | 128 | if (impa7_mtd[i]) { |
141 | #ifdef CONFIG_MTD_PARTITIONS | 129 | mtd_device_unregister(impa7_mtd[i]); |
142 | del_mtd_partitions(impa7_mtd[i]); | ||
143 | #else | ||
144 | del_mtd_device(impa7_mtd[i]); | ||
145 | #endif | ||
146 | map_destroy(impa7_mtd[i]); | 130 | map_destroy(impa7_mtd[i]); |
147 | iounmap((void *)impa7_map[i].virt); | 131 | iounmap((void *)impa7_map[i].virt); |
148 | impa7_map[i].virt = 0; | 132 | impa7_map[i].virt = 0; |