diff options
-rw-r--r-- | drivers/mtd/maps/nettel.c | 61 |
1 files changed, 2 insertions, 59 deletions
diff --git a/drivers/mtd/maps/nettel.c b/drivers/mtd/maps/nettel.c index 88525622e967..0c9b305a72e0 100644 --- a/drivers/mtd/maps/nettel.c +++ b/drivers/mtd/maps/nettel.c | |||
@@ -158,68 +158,11 @@ static struct notifier_block nettel_notifier_block = { | |||
158 | nettel_reboot_notifier, NULL, 0 | 158 | nettel_reboot_notifier, NULL, 0 |
159 | }; | 159 | }; |
160 | 160 | ||
161 | /* | ||
162 | * Erase the configuration file system. | ||
163 | * Used to support the software reset button. | ||
164 | */ | ||
165 | static void nettel_erasecallback(struct erase_info *done) | ||
166 | { | ||
167 | wait_queue_head_t *wait_q = (wait_queue_head_t *)done->priv; | ||
168 | wake_up(wait_q); | ||
169 | } | ||
170 | |||
171 | static struct erase_info nettel_erase; | ||
172 | |||
173 | int nettel_eraseconfig(void) | ||
174 | { | ||
175 | struct mtd_info *mtd; | ||
176 | DECLARE_WAITQUEUE(wait, current); | ||
177 | wait_queue_head_t wait_q; | ||
178 | int ret; | ||
179 | |||
180 | init_waitqueue_head(&wait_q); | ||
181 | mtd = get_mtd_device(NULL, 2); | ||
182 | if (!IS_ERR(mtd)) { | ||
183 | nettel_erase.mtd = mtd; | ||
184 | nettel_erase.callback = nettel_erasecallback; | ||
185 | nettel_erase.callback = NULL; | ||
186 | nettel_erase.addr = 0; | ||
187 | nettel_erase.len = mtd->size; | ||
188 | nettel_erase.priv = (u_long) &wait_q; | ||
189 | nettel_erase.priv = 0; | ||
190 | |||
191 | set_current_state(TASK_INTERRUPTIBLE); | ||
192 | add_wait_queue(&wait_q, &wait); | ||
193 | |||
194 | ret = mtd->erase(mtd, &nettel_erase); | ||
195 | if (ret) { | ||
196 | set_current_state(TASK_RUNNING); | ||
197 | remove_wait_queue(&wait_q, &wait); | ||
198 | put_mtd_device(mtd); | ||
199 | return(ret); | ||
200 | } | ||
201 | |||
202 | schedule(); /* Wait for erase to finish. */ | ||
203 | remove_wait_queue(&wait_q, &wait); | ||
204 | |||
205 | put_mtd_device(mtd); | ||
206 | } | ||
207 | |||
208 | return(0); | ||
209 | } | ||
210 | |||
211 | #else | ||
212 | |||
213 | int nettel_eraseconfig(void) | ||
214 | { | ||
215 | return(0); | ||
216 | } | ||
217 | |||
218 | #endif | 161 | #endif |
219 | 162 | ||
220 | /****************************************************************************/ | 163 | /****************************************************************************/ |
221 | 164 | ||
222 | int __init nettel_init(void) | 165 | static int __init nettel_init(void) |
223 | { | 166 | { |
224 | volatile unsigned long *amdpar; | 167 | volatile unsigned long *amdpar; |
225 | unsigned long amdaddr, maxsize; | 168 | unsigned long amdaddr, maxsize; |
@@ -473,7 +416,7 @@ out_unmap2: | |||
473 | 416 | ||
474 | /****************************************************************************/ | 417 | /****************************************************************************/ |
475 | 418 | ||
476 | void __exit nettel_cleanup(void) | 419 | static void __exit nettel_cleanup(void) |
477 | { | 420 | { |
478 | #ifdef CONFIG_MTD_CFI_INTELEXT | 421 | #ifdef CONFIG_MTD_CFI_INTELEXT |
479 | unregister_reboot_notifier(&nettel_notifier_block); | 422 | unregister_reboot_notifier(&nettel_notifier_block); |