diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 11:29:55 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:24 -0500 |
| commit | a2cc5ba075f9bc837d0b4d4ec7328dcefc11859d (patch) | |
| tree | a5f2c88ddd21028247bfaf02ca336dd501ed3a5f /include/linux | |
| parent | fd2819bbc92fc98bed5d612e4acbe16b6326f6bf (diff) | |
mtd: introduce mtd_write_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 | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 0db8d87ce451..abbc96ad3b2c 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -190,16 +190,14 @@ struct mtd_info { | |||
| 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, | 191 | int (*read_oob) (struct mtd_info *mtd, loff_t from, |
| 192 | struct mtd_oob_ops *ops); | 192 | struct mtd_oob_ops *ops); |
| 193 | int (*write_oob) (struct mtd_info *mtd, loff_t to, | ||
| 194 | struct mtd_oob_ops *ops); | ||
| 193 | 195 | ||
| 194 | /* Backing device capabilities for this device | 196 | /* Backing device capabilities for this device |
| 195 | * - provides mmap capabilities | 197 | * - provides mmap capabilities |
| 196 | */ | 198 | */ |
| 197 | struct backing_dev_info *backing_dev_info; | 199 | struct backing_dev_info *backing_dev_info; |
| 198 | 200 | ||
| 199 | |||
| 200 | int (*write_oob) (struct mtd_info *mtd, loff_t to, | ||
| 201 | struct mtd_oob_ops *ops); | ||
| 202 | |||
| 203 | /* | 201 | /* |
| 204 | * Methods to access the protection register area, present in some | 202 | * Methods to access the protection register area, present in some |
| 205 | * flash devices. The user data is one time programmable but the | 203 | * flash devices. The user data is one time programmable but the |
| @@ -326,6 +324,12 @@ static inline int mtd_read_oob(struct mtd_info *mtd, loff_t from, | |||
| 326 | return mtd->read_oob(mtd, from, ops); | 324 | return mtd->read_oob(mtd, from, ops); |
| 327 | } | 325 | } |
| 328 | 326 | ||
| 327 | static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to, | ||
| 328 | struct mtd_oob_ops *ops) | ||
| 329 | { | ||
| 330 | return mtd->write_oob(mtd, to, ops); | ||
| 331 | } | ||
| 332 | |||
| 329 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 333 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 330 | { | 334 | { |
| 331 | return dev ? dev_get_drvdata(dev) : NULL; | 335 | return dev ? dev_get_drvdata(dev) : NULL; |
