diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 10:35:41 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:20 -0500 |
| commit | eda95cbf75193808f62948fb0142ba0901d8bee2 (patch) | |
| tree | 047bcfa05bc118b1d34327b3e62fa1d10d4bcb43 /include/linux | |
| parent | 329ad399a9b3adf52c90637b21ca029fcf7f8795 (diff) | |
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/linux')
| -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 { | |||
| 184 | unsigned long flags); | 184 | unsigned long flags); |
| 185 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, | 185 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, |
| 186 | size_t *retlen, u_char *buf); | 186 | size_t *retlen, u_char *buf); |
| 187 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, | ||
| 188 | size_t *retlen, const u_char *buf); | ||
| 187 | 189 | ||
| 188 | /* Backing device capabilities for this device | 190 | /* Backing device capabilities for this device |
| 189 | * - provides mmap capabilities | 191 | * - provides mmap capabilities |
| @@ -191,7 +193,6 @@ struct mtd_info { | |||
| 191 | struct backing_dev_info *backing_dev_info; | 193 | struct backing_dev_info *backing_dev_info; |
| 192 | 194 | ||
| 193 | 195 | ||
| 194 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); | ||
| 195 | 196 | ||
| 196 | /* In blackbox flight recorder like scenarios we want to make successful | 197 | /* In blackbox flight recorder like scenarios we want to make successful |
| 197 | writes in interrupt context. panic_write() is only intended to be | 198 | 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, | |||
| 308 | return mtd->read(mtd, from, len, retlen, buf); | 309 | return mtd->read(mtd, from, len, retlen, buf); |
| 309 | } | 310 | } |
| 310 | 311 | ||
| 312 | static inline int mtd_write(struct mtd_info *mtd, loff_t to, size_t len, | ||
| 313 | size_t *retlen, const u_char *buf) | ||
| 314 | { | ||
| 315 | return mtd->write(mtd, to, len, retlen, buf); | ||
| 316 | } | ||
| 317 | |||
| 311 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 318 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 312 | { | 319 | { |
| 313 | return dev ? dev_get_drvdata(dev) : NULL; | 320 | return dev ? dev_get_drvdata(dev) : NULL; |
