diff options
author | Kamal Dasu <kdasu.kdev@gmail.com> | 2019-05-16 19:41:46 +0300 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2019-06-27 21:06:40 +0300 |
commit | 9f897bfdd89f5f08a12fa263a7f57fbf8ad9292f (patch) | |
tree | f8301f91b88e4ef576de73b8fa936ecb47b3fb4a /drivers/mtd/mtdcore.c | |
parent | 33535b85478d253a234a2779f28992a4d1766629 (diff) | |
download | linux-9f897bfdd89f5f08a12fa263a7f57fbf8ad9292f.tar.xz |
mtd: Add flag to indicate panic_write
Added a flag to indicate a panic_write so that low level drivers can
use it to take required action where applicable, to ensure oops data
gets written to assigned mtd device.
Signed-off-by: Kamal Dasu <kdasu.kdev@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'drivers/mtd/mtdcore.c')
-rw-r--r-- | drivers/mtd/mtdcore.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c index 453242d6cf56..408615f29e57 100644 --- a/drivers/mtd/mtdcore.c +++ b/drivers/mtd/mtdcore.c @@ -1124,6 +1124,9 @@ 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; + return mtd->_panic_write(mtd, to, len, retlen, buf); } EXPORT_SYMBOL_GPL(mtd_panic_write); |