mtd: mtd->write_user_prot_reg directly
Instead, just call 'mtd_write_user_prot_reg()' and check the '-EOPNOTSUPP' return code. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
This commit is contained in:

committed by
David Woodhouse

parent
b6de3d6cb6
commit
27c151a5e5
@@ -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;
|
||||
|
Reference in New Issue
Block a user