Commit 27c151a5 authored by Artem Bityutskiy's avatar Artem Bityutskiy Committed by David Woodhouse

mtd: mtd->write_user_prot_reg directly

Instead, just call 'mtd_write_user_prot_reg()' and check the '-EOPNOTSUPP' return
code.
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent b6de3d6c
......@@ -310,10 +310,6 @@ static ssize_t mtdchar_write(struct file *file, const char __user *buf, size_t c
ret = -EROFS;
break;
case MTD_FILE_MODE_OTP_USER:
if (!mtd->write_user_prot_reg) {
ret = -EOPNOTSUPP;
break;
}
ret = mtd_write_user_prot_reg(mtd, *ppos, len,
&retlen, kbuf);
break;
......
......@@ -381,6 +381,8 @@ static inline int mtd_write_user_prot_reg(struct mtd_info *mtd, loff_t to,
u_char *buf)
{
*retlen = 0;
if (!mtd->write_user_prot_reg)
return -EOPNOTSUPP;
return mtd->write_user_prot_reg(mtd, to, len, retlen, buf);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment