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>
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;
u_char *buf)
{
*retlen = 0;
+ if (!mtd->write_user_prot_reg)
+ return -EOPNOTSUPP;
return mtd->write_user_prot_reg(mtd, to, len, retlen, buf);
}