diff options
| author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2011-12-23 11:50:04 -0500 |
|---|---|---|
| committer | David Woodhouse <David.Woodhouse@intel.com> | 2012-01-09 13:25:31 -0500 |
| commit | 482b43adbb7b124316ec72c161b0d1655e759368 (patch) | |
| tree | cbf1b3f4d664ea12fbe177d51c94c9b9b608d99b /include/linux | |
| parent | 4ea1cabb926f03a8dbd6e3f064538d9a290ee9fd (diff) | |
mtd: introduce mtd_write_user_prot_reg 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, 9 insertions, 1 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index 855fb7fab69..554960793e3 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
| @@ -200,13 +200,14 @@ struct mtd_info { | |||
| 200 | size_t len); | 200 | size_t len); |
| 201 | int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, | 201 | int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, |
| 202 | size_t len, size_t *retlen, u_char *buf); | 202 | size_t len, size_t *retlen, u_char *buf); |
| 203 | int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t to, size_t len, | ||
| 204 | size_t *retlen, u_char *buf); | ||
| 203 | 205 | ||
| 204 | /* Backing device capabilities for this device | 206 | /* Backing device capabilities for this device |
| 205 | * - provides mmap capabilities | 207 | * - provides mmap capabilities |
| 206 | */ | 208 | */ |
| 207 | struct backing_dev_info *backing_dev_info; | 209 | struct backing_dev_info *backing_dev_info; |
| 208 | 210 | ||
| 209 | int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf); | ||
| 210 | int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); | 211 | int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); |
| 211 | 212 | ||
| 212 | /* kvec-based read/write methods. | 213 | /* kvec-based read/write methods. |
| @@ -361,6 +362,13 @@ static inline int mtd_read_user_prot_reg(struct mtd_info *mtd, loff_t from, | |||
| 361 | return mtd->read_user_prot_reg(mtd, from, len, retlen, buf); | 362 | return mtd->read_user_prot_reg(mtd, from, len, retlen, buf); |
| 362 | } | 363 | } |
| 363 | 364 | ||
| 365 | static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, | ||
| 366 | size_t len, size_t *retlen, | ||
| 367 | u_char *buf) | ||
| 368 | { | ||
| 369 | return mtd->write_user_prot_reg(mtd, to, len, retlen, buf); | ||
| 370 | } | ||
| 371 | |||
| 364 | static inline struct mtd_info *dev_to_mtd(struct device *dev) | 372 | static inline struct mtd_info *dev_to_mtd(struct device *dev) |
| 365 | { | 373 | { |
| 366 | return dev ? dev_get_drvdata(dev) : NULL; | 374 | return dev ? dev_get_drvdata(dev) : NULL; |
