diff options
Diffstat (limited to 'drivers/mtd/mtdoops.c')
-rw-r--r-- | drivers/mtd/mtdoops.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c index 1687521b4aa4..34681bc91105 100644 --- a/drivers/mtd/mtdoops.c +++ b/drivers/mtd/mtdoops.c | |||
@@ -67,10 +67,7 @@ static int mtdoops_erase_block(struct mtd_info *mtd, int offset) | |||
67 | erase.mtd = mtd; | 67 | erase.mtd = mtd; |
68 | erase.callback = mtdoops_erase_callback; | 68 | erase.callback = mtdoops_erase_callback; |
69 | erase.addr = offset; | 69 | erase.addr = offset; |
70 | if (mtd->erasesize < OOPS_PAGE_SIZE) | 70 | erase.len = mtd->erasesize; |
71 | erase.len = OOPS_PAGE_SIZE; | ||
72 | else | ||
73 | erase.len = mtd->erasesize; | ||
74 | erase.priv = (u_long)&wait_q; | 71 | erase.priv = (u_long)&wait_q; |
75 | 72 | ||
76 | set_current_state(TASK_INTERRUPTIBLE); | 73 | set_current_state(TASK_INTERRUPTIBLE); |
@@ -271,12 +268,18 @@ static void mtdoops_notify_add(struct mtd_info *mtd) | |||
271 | return; | 268 | return; |
272 | } | 269 | } |
273 | 270 | ||
271 | if (mtd->erasesize < OOPS_PAGE_SIZE) { | ||
272 | printk(KERN_ERR "Eraseblock size of MTD partition %d too small\n", | ||
273 | mtd->index); | ||
274 | return; | ||
275 | } | ||
276 | |||
274 | cxt->mtd = mtd; | 277 | cxt->mtd = mtd; |
275 | cxt->oops_pages = mtd->size / OOPS_PAGE_SIZE; | 278 | cxt->oops_pages = mtd->size / OOPS_PAGE_SIZE; |
276 | 279 | ||
277 | find_next_position(cxt); | 280 | find_next_position(cxt); |
278 | 281 | ||
279 | printk(KERN_DEBUG "mtdoops: Attached to MTD device %d\n", mtd->index); | 282 | printk(KERN_INFO "mtdoops: Attached to MTD device %d\n", mtd->index); |
280 | } | 283 | } |
281 | 284 | ||
282 | static void mtdoops_notify_remove(struct mtd_info *mtd) | 285 | static void mtdoops_notify_remove(struct mtd_info *mtd) |
@@ -377,7 +380,6 @@ static struct console mtdoops_console = { | |||
377 | .write = mtdoops_console_write, | 380 | .write = mtdoops_console_write, |
378 | .setup = mtdoops_console_setup, | 381 | .setup = mtdoops_console_setup, |
379 | .unblank = mtdoops_console_sync, | 382 | .unblank = mtdoops_console_sync, |
380 | .flags = CON_PRINTBUFFER, | ||
381 | .index = -1, | 383 | .index = -1, |
382 | .data = &oops_cxt, | 384 | .data = &oops_cxt, |
383 | }; | 385 | }; |
@@ -390,7 +392,7 @@ static int __init mtdoops_console_init(void) | |||
390 | cxt->oops_buf = vmalloc(OOPS_PAGE_SIZE); | 392 | cxt->oops_buf = vmalloc(OOPS_PAGE_SIZE); |
391 | 393 | ||
392 | if (!cxt->oops_buf) { | 394 | if (!cxt->oops_buf) { |
393 | printk(KERN_ERR "Failed to allocate oops buffer workspace\n"); | 395 | printk(KERN_ERR "Failed to allocate mtdoops buffer workspace\n"); |
394 | return -ENOMEM; | 396 | return -ENOMEM; |
395 | } | 397 | } |
396 | 398 | ||