diff options
Diffstat (limited to 'include/linux/mtd')
| -rw-r--r-- | include/linux/mtd/mtd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 671c89289fc3..f0dd5a305b89 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -291,6 +291,8 @@ static inline int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
| 291 | size_t *retlen, const u_char *buf) | 291 | size_t *retlen, const u_char *buf) |
| 292 | { | 292 | { |
| 293 | *retlen = 0; | 293 | *retlen = 0; |
| 294 | if (!mtd->write) | ||
| 295 | return -EROFS; | ||
| 294 | return mtd->write(mtd, to, len, retlen, buf); | 296 | return mtd->write(mtd, to, len, retlen, buf); |
| 295 | } | 297 | } |
| 296 | 298 | ||
