Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 282906
b: refs/heads/master
c: 016c129
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and David Woodhouse committed Jan 9, 2012
1 parent 0761453 commit a1ef4a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 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: 4991e7251ed951a5f33faf25912e9db416306309
refs/heads/master: 016c1291ce70a22f15f666441a4fd2f0b450375b
17 changes: 8 additions & 9 deletions trunk/drivers/mtd/mtdoops.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,14 @@ static void mtdoops_write(struct mtdoops_context *cxt, int panic)
hdr[0] = cxt->nextcount;
hdr[1] = MTDOOPS_KERNMSG_MAGIC;

if (panic)
if (panic) {
ret = mtd_panic_write(mtd, cxt->nextpage * record_size,
record_size, &retlen, cxt->oops_buf);
else
if (ret == -EOPNOTSUPP) {
printk(KERN_ERR "mtdoops: Cannot write from panic without panic_write\n");
return;
}
} else
ret = mtd_write(mtd, cxt->nextpage * record_size,
record_size, &retlen, cxt->oops_buf);

Expand Down Expand Up @@ -330,13 +334,8 @@ static void mtdoops_do_dump(struct kmsg_dumper *dumper,
memcpy(dst + l1_cpy, s2 + s2_start, l2_cpy);

/* Panics must be written immediately */
if (reason != KMSG_DUMP_OOPS) {
if (!cxt->mtd->panic_write)
printk(KERN_ERR "mtdoops: Cannot write from panic without panic_write\n");
else
mtdoops_write(cxt, 1);
return;
}
if (reason != KMSG_DUMP_OOPS)
mtdoops_write(cxt, 1);

/* For other cases, schedule work to write it "nicely" */
schedule_work(&cxt->work_write);
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/mtd/mtd.h
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@ static inline int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf)
{
*retlen = 0;
if (!mtd->panic_write)
return -EOPNOTSUPP;
return mtd->panic_write(mtd, to, len, retlen, buf);
}

Expand Down

0 comments on commit a1ef4a3

Please sign in to comment.