Instead, check the -EOPNOTSUPP return code of 'mtd_lock_user_prot_reg()'.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
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;
}
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);
}