Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 84268
b: refs/heads/master
c: 79dcd8e
h: refs/heads/master
v: v3
  • Loading branch information
Richard Purdie authored and David Woodhouse committed Feb 3, 2008
1 parent b45895b commit 9f9f95b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 47c152b88c185c7e97462a35893df6e552075a8c
refs/heads/master: 79dcd8e9e1f2864ade80f45e144e5e80fef71613
16 changes: 9 additions & 7 deletions trunk/drivers/mtd/mtdoops.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ static int mtdoops_erase_block(struct mtd_info *mtd, int offset)
erase.mtd = mtd;
erase.callback = mtdoops_erase_callback;
erase.addr = offset;
if (mtd->erasesize < OOPS_PAGE_SIZE)
erase.len = OOPS_PAGE_SIZE;
else
erase.len = mtd->erasesize;
erase.len = mtd->erasesize;
erase.priv = (u_long)&wait_q;

set_current_state(TASK_INTERRUPTIBLE);
Expand Down Expand Up @@ -271,12 +268,18 @@ static void mtdoops_notify_add(struct mtd_info *mtd)
return;
}

if (mtd->erasesize < OOPS_PAGE_SIZE) {
printk(KERN_ERR "Eraseblock size of MTD partition %d too small\n",
mtd->index);
return;
}

cxt->mtd = mtd;
cxt->oops_pages = mtd->size / OOPS_PAGE_SIZE;

find_next_position(cxt);

printk(KERN_DEBUG "mtdoops: Attached to MTD device %d\n", mtd->index);
printk(KERN_INFO "mtdoops: Attached to MTD device %d\n", mtd->index);
}

static void mtdoops_notify_remove(struct mtd_info *mtd)
Expand Down Expand Up @@ -377,7 +380,6 @@ static struct console mtdoops_console = {
.write = mtdoops_console_write,
.setup = mtdoops_console_setup,
.unblank = mtdoops_console_sync,
.flags = CON_PRINTBUFFER,
.index = -1,
.data = &oops_cxt,
};
Expand All @@ -390,7 +392,7 @@ static int __init mtdoops_console_init(void)
cxt->oops_buf = vmalloc(OOPS_PAGE_SIZE);

if (!cxt->oops_buf) {
printk(KERN_ERR "Failed to allocate oops buffer workspace\n");
printk(KERN_ERR "Failed to allocate mtdoops buffer workspace\n");
return -ENOMEM;
}

Expand Down

0 comments on commit 9f9f95b

Please sign in to comment.