From 26f06236363948eb47d5e137bf194182eeb6745a Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Fri, 23 Dec 2011 18:55:49 +0200 Subject: [PATCH] --- yaml --- r: 282880 b: refs/heads/master c: 4403dbfb4541d34e5db33db709094d57d09f7467 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/mtd/mtdchar.c | 2 +- trunk/drivers/mtd/mtdpart.c | 2 +- trunk/include/linux/mtd/mtd.h | 10 ++++++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 8a2101daa5bf..fc7d216324e6 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 482b43adbb7b124316ec72c161b0d1655e759368 +refs/heads/master: 4403dbfb4541d34e5db33db709094d57d09f7467 diff --git a/trunk/drivers/mtd/mtdchar.c b/trunk/drivers/mtd/mtdchar.c index d8881707ca60..86308acb40e0 100644 --- a/trunk/drivers/mtd/mtdchar.c +++ b/trunk/drivers/mtd/mtdchar.c @@ -960,7 +960,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg) return -EFAULT; if (!mtd->lock_user_prot_reg) return -EOPNOTSUPP; - ret = mtd->lock_user_prot_reg(mtd, oinfo.start, oinfo.length); + ret = mtd_lock_user_prot_reg(mtd, oinfo.start, oinfo.length); break; } #endif diff --git a/trunk/drivers/mtd/mtdpart.c b/trunk/drivers/mtd/mtdpart.c index 1e7b8d1693aa..0bb16d6ed08a 100644 --- a/trunk/drivers/mtd/mtdpart.c +++ b/trunk/drivers/mtd/mtdpart.c @@ -229,7 +229,7 @@ static int part_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len) { struct mtd_part *part = PART(mtd); - return part->master->lock_user_prot_reg(part->master, from, len); + return mtd_lock_user_prot_reg(part->master, from, len); } static int part_writev(struct mtd_info *mtd, const struct kvec *vecs, diff --git a/trunk/include/linux/mtd/mtd.h b/trunk/include/linux/mtd/mtd.h index 554960793e37..b58e5e8746ec 100644 --- a/trunk/include/linux/mtd/mtd.h +++ b/trunk/include/linux/mtd/mtd.h @@ -202,14 +202,14 @@ struct mtd_info { size_t len, size_t *retlen, u_char *buf); int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, u_char *buf); + int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, + size_t len); /* Backing device capabilities for this device * - provides mmap capabilities */ struct backing_dev_info *backing_dev_info; - int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len); - /* kvec-based read/write methods. NB: The 'count' parameter is the number of _vectors_, each of 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, return mtd->write_user_prot_reg(mtd, to, len, retlen, buf); } +static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, + size_t len) +{ + return mtd->lock_user_prot_reg(mtd, from, len); +} + static inline struct mtd_info *dev_to_mtd(struct device *dev) { return dev ? dev_get_drvdata(dev) : NULL;