Skip to content

Commit

Permalink
mtd: set master partition panic write flag
Browse files Browse the repository at this point in the history
Check and set master panic write flag so that low level drivers
can use it to take required action to ensure oops data gets written
to assigned mtdoops device partition.

Fixes: 9f897bf ("mtd: Add flag to indicate panic_write")
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20200615155134.32007-1-kdasu.kdev@gmail.com
  • Loading branch information
Kamal Dasu authored and Miquel Raynal committed Jun 15, 2020
1 parent 1f6ce44 commit 630e8d5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/mtdcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,8 +1273,8 @@ int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen,
return -EROFS;
if (!len)
return 0;
if (!mtd->oops_panic_write)
mtd->oops_panic_write = true;
if (!master->oops_panic_write)
master->oops_panic_write = true;

return master->_panic_write(master, mtd_get_master_ofs(mtd, to), len,
retlen, buf);
Expand Down

0 comments on commit 630e8d5

Please sign in to comment.