aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/mtdchar.c2
-rw-r--r--drivers/mtd/mtdpart.c2
-rw-r--r--include/linux/mtd/mtd.h10
3 files changed, 10 insertions, 4 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index d8881707ca60..86308acb40e0 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -960,7 +960,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
960 return -EFAULT; 960 return -EFAULT;
961 if (!mtd->lock_user_prot_reg) 961 if (!mtd->lock_user_prot_reg)
962 return -EOPNOTSUPP; 962 return -EOPNOTSUPP;
963 ret = mtd->lock_user_prot_reg(mtd, oinfo.start, oinfo.length); 963 ret = mtd_lock_user_prot_reg(mtd, oinfo.start, oinfo.length);
964 break; 964 break;
965 } 965 }
966#endif 966#endif
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 1e7b8d1693aa..0bb16d6ed08a 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -229,7 +229,7 @@ static int part_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
229 size_t len) 229 size_t len)
230{ 230{
231 struct mtd_part *part = PART(mtd); 231 struct mtd_part *part = PART(mtd);
232 return part->master->lock_user_prot_reg(part->master, from, len); 232 return mtd_lock_user_prot_reg(part->master, from, len);
233} 233}
234 234
235static int part_writev(struct mtd_info *mtd, const struct kvec *vecs, 235static int part_writev(struct mtd_info *mtd, const struct kvec *vecs,
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;