diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 10:30:16 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:19 -0500 |
| commit | 329ad399a9b3adf52c90637b21ca029fcf7f8795 (patch) | |
| tree | 7aa7bb2609c25de7859c3a666f3ea90934609592 /include/linux | |
| parent | 04c601bfa4cb29c968dcb66e44c799c9c01d8675 (diff) | |
mtd: introduce mtd_read 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 f38e8276b40..56478eb4bbc 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -182,6 +182,8 @@ struct mtd_info { | |||
| 182 | unsigned long len, | 182 | unsigned long len, |
| 183 | unsigned long offset, | 183 | unsigned long offset, |
| 184 | unsigned long flags); | 184 | unsigned long flags); |
| 185 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, | ||
| 186 | size_t *retlen, u_char *buf); | ||
| 185 | 187 | ||
| 186 | /* Backing device capabilities for this device | 188 | /* Backing device capabilities for this device |
| 187 | * - provides mmap capabilities | 189 | * - provides mmap capabilities |
| @@ -189,7 +191,6 @@ struct mtd_info { | |||
| 189 | struct backing_dev_info *backing_dev_info; | 191 | struct backing_dev_info *backing_dev_info; |
| 190 | 192 | ||
| 191 | 193 | ||
| 192 | int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | ||
| 193 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); | 194 | int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf); |
| 194 | 195 | ||
| 195 | /* In blackbox flight recorder like scenarios we want to make successful | 196 | /* In blackbox flight recorder like scenarios we want to make successful |
| @@ -301,6 +302,12 @@ static inline unsigned long mtd_get_unmapped_area(struct mtd_info *mtd, | |||
| 301 | return mtd->get_unmapped_area(mtd, len, offset, flags); | 302 | return mtd->get_unmapped_area(mtd, len, offset, flags); |
| 302 | } | 303 | } |
| 303 | 304 | ||
| 305 | static inline int mtd_read(struct mtd_info *mtd, loff_t from, size_t len, | ||
| 306 | size_t *retlen, u_char *buf) | ||
| 307 | { | ||
| 308 | return mtd->read(mtd, from, len, retlen, buf); | ||
| 309 | } | ||
| 310 | |||
| 304 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 311 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 305 | { | 312 | { |
| 306 | return dev ? dev_get_drvdata(dev) : NULL; | 313 | return dev ? dev_get_drvdata(dev) : NULL; |
