diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 18:59:12 +0200 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 18:25:34 +0000 |
commit | b0a31f7b2a668f00a8d0546dfeed65fac871b2da (patch) | |
tree | 7379a66d9bfd6ae067f090f1bebac5d47332f5cb /include/linux/mtd | |
parent | 4403dbfb4541d34e5db33db709094d57d09f7467 (diff) | |
download | kernel_goldelico_gta04-b0a31f7b2a668f00a8d0546dfeed65fac871b2da.zip kernel_goldelico_gta04-b0a31f7b2a668f00a8d0546dfeed65fac871b2da.tar.gz kernel_goldelico_gta04-b0a31f7b2a668f00a8d0546dfeed65fac871b2da.tar.bz2 |
mtd: introduce mtd_writev 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/mtd')
-rw-r--r-- | include/linux/mtd/mtd.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index b58e5e8..4129cb5 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h @@ -204,18 +204,14 @@ struct mtd_info { size_t *retlen, u_char *buf); int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); + int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, + unsigned long count, loff_t to, size_t *retlen); /* Backing device capabilities for this device * - provides mmap capabilities */ struct backing_dev_info *backing_dev_info; - /* kvec-based read/write methods. - NB: The 'count' parameter is the number of _vectors_, each of - which contains an (ofs, len) tuple. - */ - int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen); - /* Sync */ void (*sync) (struct mtd_info *mtd); @@ -375,6 +371,16 @@ static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, return mtd->lock_user_prot_reg(mtd, from, len); } +/* + * kvec-based read/write method. NB: The 'count' parameter is the number of + * _vectors_, each of which contains an (ofs, len) tuple. + */ +static inline int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, + unsigned long count, loff_t to, size_t *retlen) +{ + return mtd->writev(mtd, vecs, count, to, retlen); +} + static inline struct mtd_info *dev_to_mtd(struct device *dev) { return dev ? dev_get_drvdata(dev) : NULL; |