diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 11:27:05 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:23 -0500 |
| commit | fd2819bbc92fc98bed5d612e4acbe16b6326f6bf (patch) | |
| tree | 114f2a130cb854c74707eb805854fe048f65ac14 /include/linux | |
| parent | 7ae79d7ff1769a3e9c47076b46e4eaa11204a2ee (diff) | |
mtd: introduce mtd_read_oob 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 | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 2fb83cd3d264..0db8d87ce451 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -188,6 +188,8 @@ struct mtd_info { | |||
| 188 | size_t *retlen, const u_char *buf); | 188 | size_t *retlen, const u_char *buf); |
| 189 | int (*panic_write) (struct mtd_info *mtd, loff_t to, size_t len, | 189 | int (*panic_write) (struct mtd_info *mtd, loff_t to, size_t len, |
| 190 | size_t *retlen, const u_char *buf); | 190 | size_t *retlen, const u_char *buf); |
| 191 | int (*read_oob) (struct mtd_info *mtd, loff_t from, | ||
| 192 | struct mtd_oob_ops *ops); | ||
| 191 | 193 | ||
| 192 | /* Backing device capabilities for this device | 194 | /* Backing device capabilities for this device |
| 193 | * - provides mmap capabilities | 195 | * - provides mmap capabilities |
| @@ -195,8 +197,6 @@ struct mtd_info { | |||
| 195 | struct backing_dev_info *backing_dev_info; | 197 | struct backing_dev_info *backing_dev_info; |
| 196 | 198 | ||
| 197 | 199 | ||
| 198 | int (*read_oob) (struct mtd_info *mtd, loff_t from, | ||
| 199 | struct mtd_oob_ops *ops); | ||
| 200 | int (*write_oob) (struct mtd_info *mtd, loff_t to, | 200 | int (*write_oob) (struct mtd_info *mtd, loff_t to, |
| 201 | struct mtd_oob_ops *ops); | 201 | struct mtd_oob_ops *ops); |
| 202 | 202 | ||
| @@ -320,6 +320,12 @@ static inline int mtd_panic_write(struct mtd_info *mtd, loff_t to, size_t len, | |||
| 320 | return mtd->panic_write(mtd, to, len, retlen, buf); | 320 | return mtd->panic_write(mtd, to, len, retlen, buf); |
| 321 | } | 321 | } |
| 322 | 322 | ||
| 323 | static inline int mtd_read_oob(struct mtd_info *mtd, loff_t from, | ||
| 324 | struct mtd_oob_ops *ops) | ||
| 325 | { | ||
| 326 | return mtd->read_oob(mtd, from, ops); | ||
| 327 | } | ||
| 328 | |||
| 323 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 329 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 324 | { | 330 | { |
| 325 | return dev ? dev_get_drvdata(dev) : NULL; | 331 | return dev ? dev_get_drvdata(dev) : NULL; |
