diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 17:35:41 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 18:25:20 +0000 |
commit | eda95cbf75193808f62948fb0142ba0901d8bee2 (patch) | |
tree | 047bcfa05bc118b1d34327b3e62fa1d10d4bcb43 /include | |
parent | 329ad399a9b3adf52c90637b21ca029fcf7f8795 (diff) | |
download | linux-eda95cbf75193808f62948fb0142ba0901d8bee2.tar.bz2 |
mtd: introduce mtd_write interface
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mtd/mtd.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 56478eb4bbc0..1da7f4a6ef88 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -184,6 +184,8 @@ struct mtd_info { unsigned long flags); int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); + int (*write) (struct mtd_info *mtd, loff_t to, size_t len, + size_t *retlen, const u_char *buf); /* Backing device capabilities for this device * - provides mmap capabilities @@ -191,7 +193,6 @@ struct mtd_info { struct backing_dev_info *backing_dev_info; - int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); /* In blackbox flight recorder like scenarios we want to make successful writes in interrupt context. panic_write() is only intended to be @@ -308,6 +309,12 @@ static inline int mtd_read(struct mtd_info *mtd, loff_t from, size_t len, return mtd->read(mtd, from, len, retlen, buf); } +static inline int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, + size_t *retlen, const u_char *buf) +{ + return mtd->write(mtd, to, len, retlen, buf); +} + static inline struct mtd_info *dev_to_mtd(struct device *dev) { return dev ? dev_get_drvdata(dev) : NULL; |