diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 12:03:12 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:35 -0500 |
| commit | 85f2f2a809d658c15b574df02ede92090f45a1f2 (patch) | |
| tree | 7d4ae7ca646db856aca7f2509c404b9d938fee0b /include | |
| parent | b0a31f7b2a668f00a8d0546dfeed65fac871b2da (diff) | |
mtd: introduce mtd_sync 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, 6 insertions, 3 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 4129cb5c3de4..47ea19c1e523 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -206,15 +206,13 @@ struct mtd_info { | |||
| 206 | size_t len); | 206 | size_t len); |
| 207 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, | 207 | int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, |
| 208 | unsigned long count, loff_t to, size_t *retlen); | 208 | unsigned long count, loff_t to, size_t *retlen); |
| 209 | void (*sync) (struct mtd_info *mtd); | ||
| 209 | 210 | ||
| 210 | /* Backing device capabilities for this device | 211 | /* Backing device capabilities for this device |
| 211 | * - provides mmap capabilities | 212 | * - provides mmap capabilities |
| 212 | */ | 213 | */ |
| 213 | struct backing_dev_info *backing_dev_info; | 214 | struct backing_dev_info *backing_dev_info; |
| 214 | 215 | ||
| 215 | /* Sync */ | ||
| 216 | void (*sync) (struct mtd_info *mtd); | ||
| 217 | |||
| 218 | /* Chip-supported device locking */ | 216 | /* Chip-supported device locking */ |
| 219 | int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 217 | int (*lock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
| 220 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); | 218 | int (*unlock) (struct mtd_info *mtd, loff_t ofs, uint64_t len); |
| @@ -381,6 +379,11 @@ static inline int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, | |||
| 381 | return mtd->writev(mtd, vecs, count, to, retlen); | 379 | return mtd->writev(mtd, vecs, count, to, retlen); |
| 382 | } | 380 | } |
| 383 | 381 | ||
| 382 | static inline void mtd_sync(struct mtd_info *mtd) | ||
| 383 | { | ||
| 384 | mtd->sync(mtd); | ||
| 385 | } | ||
| 386 | |||
| 384 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 387 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 385 | { | 388 | { |
| 386 | return dev ? dev_get_drvdata(dev) : NULL; | 389 | return dev ? dev_get_drvdata(dev) : NULL; |
