aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-23 11:55:49 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:25:33 -0500
commit4403dbfb4541d34e5db33db709094d57d09f7467 (patch)
treec01500ee2c1c2b99b962a2e289299020ff95846a /include
parent482b43adbb7b124316ec72c161b0d1655e759368 (diff)
mtd: introduce mtd_lock_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')
-rw-r--r--include/linux/mtd/mtd.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 554960793e37..b58e5e8746ec 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -202,14 +202,14 @@ struct mtd_info {
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, 203 int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t to, size_t len,
204 size_t *retlen, u_char *buf); 204 size_t *retlen, u_char *buf);
205 int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from,
206 size_t len);
205 207
206 /* Backing device capabilities for this device 208 /* Backing device capabilities for this device
207 * - provides mmap capabilities 209 * - provides mmap capabilities
208 */ 210 */
209 struct backing_dev_info *backing_dev_info; 211 struct backing_dev_info *backing_dev_info;
210 212
211 int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len);
212
213 /* kvec-based read/write methods. 213 /* kvec-based read/write methods.
214 NB: The 'count' parameter is the number of _vectors_, each of 214 NB: The 'count' parameter is the number of _vectors_, each of
215 which contains an (ofs, len) tuple. 215 which contains an (ofs, len) tuple.
@@ -369,6 +369,12 @@ static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to,
369 return mtd->write_user_prot_reg(mtd, to, len, retlen, buf); 369 return mtd->write_user_prot_reg(mtd, to, len, retlen, buf);
370} 370}
371 371
372static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
373 size_t len)
374{
375 return mtd->lock_user_prot_reg(mtd, from, len);
376}
377
372static inline struct mtd_info *dev_to_mtd(struct device *dev) 378static inline struct mtd_info *dev_to_mtd(struct device *dev)
373{ 379{
374 return dev ? dev_get_drvdata(dev) : NULL; 380 return dev ? dev_get_drvdata(dev) : NULL;