aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mtd/mtdchar.c2
-rw-r--r--include/linux/mtd/mtd.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 25bbbc3aa665..2020a169ed9c 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -949,8 +949,6 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
949 return -EINVAL; 949 return -EINVAL;
950 if (copy_from_user(&oinfo, argp, sizeof(oinfo))) 950 if (copy_from_user(&oinfo, argp, sizeof(oinfo)))
951 return -EFAULT; 951 return -EFAULT;
952 if (!mtd->lock_user_prot_reg)
953 return -EOPNOTSUPP;
954 ret = mtd_lock_user_prot_reg(mtd, oinfo.start, oinfo.length); 952 ret = mtd_lock_user_prot_reg(mtd, oinfo.start, oinfo.length);
955 break; 953 break;
956 } 954 }
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 7cd56d2b9419..a994129ede55 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -389,6 +389,8 @@ static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to,
389static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from, 389static inline int mtd_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
390 size_t len) 390 size_t len)
391{ 391{
392 if (!mtd->lock_user_prot_reg)
393 return -EOPNOTSUPP;
392 return mtd->lock_user_prot_reg(mtd, from, len); 394 return mtd->lock_user_prot_reg(mtd, from, len);
393} 395}
394 396