From 2820ab4b11c42af363a460b32b31a3dfc034b0e9 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Thu, 29 Dec 2011 10:45:04 +0200 Subject: [PATCH] --- yaml --- r: 282911 b: refs/heads/master c: e2936b2af5562c8c66060e2bc2ae2e209d0acd3d h: refs/heads/master i: 282909: 6c25dbae8929d09cc505ad020072c5e7d13fb789 282907: 603f5568f24d9ee8f341a17b6138d920d059e7de 282903: cda55504a24ddb8e2454f21a9f1f428db9dcbc90 282895: 42d98c19693fee2f9d761d5515f978b38556dec9 282879: e57986ba4651c4ba6d26a0ef2c5ca8911714df85 v: v3 --- [refs] | 2 +- trunk/drivers/mtd/mtdchar.c | 2 -- trunk/include/linux/mtd/mtd.h | 2 ++ 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 074edc8e8069..b25e56a81614 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 27c151a5e52efaa46d0938984f2ef591bdcb6d5b +refs/heads/master: e2936b2af5562c8c66060e2bc2ae2e209d0acd3d diff --git a/trunk/drivers/mtd/mtdchar.c b/trunk/drivers/mtd/mtdchar.c index 25bbbc3aa665..2020a169ed9c 100644 --- a/trunk/drivers/mtd/mtdchar.c +++ b/trunk/drivers/mtd/mtdchar.c @@ -949,8 +949,6 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg) return -EINVAL; if (copy_from_user(&oinfo, argp, sizeof(oinfo))) return -EFAULT; - if (!mtd->lock_user_prot_reg) - return -EOPNOTSUPP; ret = mtd_lock_user_prot_reg(mtd, oinfo.start, oinfo.length); break; } diff --git a/trunk/include/linux/mtd/mtd.h b/trunk/include/linux/mtd/mtd.h index 7cd56d2b9419..a994129ede55 100644 --- a/trunk/include/linux/mtd/mtd.h +++ b/trunk/include/linux/mtd/mtd.h @@ -389,6 +389,8 @@ static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to, static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, size_t len) { + if (!mtd->lock_user_prot_reg) + return -EOPNOTSUPP; return mtd->lock_user_prot_reg(mtd, from, len); }