diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-30 09:23:41 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:26:19 -0500 |
| commit | 1dbebd32562b3c2caeca35960e5cb00bfcc12900 (patch) | |
| tree | 773776d87730828adb55f3f7fe8221eabb528d8f /include/linux/mtd | |
| parent | e2936b2af5562c8c66060e2bc2ae2e209d0acd3d (diff) | |
mtd: harmonize mtd_writev usage
This patch makes the 'mtd_writev()' function more usable and logical. We first
teach it to fall-back to the 'default_mtd_writev()' function if the MTD driver
does not define its own '->writev()' method. Then we make block2mtd and JFFS2
just 'mtd_writev()' instead of 'default_mtd_writev()' function. This means we
can now stop exporting 'default_mtd_writev()' and instead, export
'mtd_writev()'. This is much cleaner and more logical, as well as allows us to
get read of another direct 'mtd->writev' access in JFFS2.
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 | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index a994129ede55..a58ecf4d1f80 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -394,16 +394,8 @@ static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, | |||
| 394 | return mtd->lock_user_prot_reg(mtd, from, len); | 394 | return mtd->lock_user_prot_reg(mtd, from, len); |
| 395 | } | 395 | } |
| 396 | 396 | ||
| 397 | /* | 397 | int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, |
| 398 | * kvec-based read/write method. NB: The 'count' parameter is the number of | 398 | unsigned long count, loff_t to, size_t *retlen); |
| 399 | * _vectors_, each of which contains an (ofs, len) tuple. | ||
| 400 | */ | ||
| 401 | static inline int mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, | ||
| 402 | unsigned long count, loff_t to, size_t *retlen) | ||
| 403 | { | ||
| 404 | *retlen = 0; | ||
| 405 | return mtd->writev(mtd, vecs, count, to, retlen); | ||
| 406 | } | ||
| 407 | 399 | ||
| 408 | static inline void mtd_sync(struct mtd_info *mtd) | 400 | static inline void mtd_sync(struct mtd_info *mtd) |
| 409 | { | 401 | { |
| @@ -510,10 +502,6 @@ struct mtd_notifier { | |||
| 510 | 502 | ||
| 511 | extern void register_mtd_user (struct mtd_notifier *new); | 503 | extern void register_mtd_user (struct mtd_notifier *new); |
| 512 | extern int unregister_mtd_user (struct mtd_notifier *old); | 504 | extern int unregister_mtd_user (struct mtd_notifier *old); |
| 513 | |||
| 514 | int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs, | ||
| 515 | unsigned long count, loff_t to, size_t *retlen); | ||
| 516 | |||
| 517 | void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size); | 505 | void *mtd_kmalloc_up_to(const struct mtd_info *mtd, size_t *size); |
| 518 | 506 | ||
| 519 | void mtd_erase_callback(struct erase_info *instr); | 507 | void mtd_erase_callback(struct erase_info *instr); |
