mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-05-02 18:15:03 -04:00
mtd: do not use mtd->lock, unlock and is_locked directly
Instead, call the corresponding MTD API function which will return '-EOPNOTSUPP' if the operation is not supported. 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
327cf2922b
commit
381345652f
@@ -814,10 +814,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
|
||||
if (copy_from_user(&einfo, argp, sizeof(einfo)))
|
||||
return -EFAULT;
|
||||
|
||||
if (!mtd->lock)
|
||||
ret = -EOPNOTSUPP;
|
||||
else
|
||||
ret = mtd_lock(mtd, einfo.start, einfo.length);
|
||||
ret = mtd_lock(mtd, einfo.start, einfo.length);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -828,10 +825,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
|
||||
if (copy_from_user(&einfo, argp, sizeof(einfo)))
|
||||
return -EFAULT;
|
||||
|
||||
if (!mtd->unlock)
|
||||
ret = -EOPNOTSUPP;
|
||||
else
|
||||
ret = mtd_unlock(mtd, einfo.start, einfo.length);
|
||||
ret = mtd_unlock(mtd, einfo.start, einfo.length);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -842,10 +836,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
|
||||
if (copy_from_user(&einfo, argp, sizeof(einfo)))
|
||||
return -EFAULT;
|
||||
|
||||
if (!mtd->is_locked)
|
||||
ret = -EOPNOTSUPP;
|
||||
else
|
||||
ret = mtd_is_locked(mtd, einfo.start, einfo.length);
|
||||
ret = mtd_is_locked(mtd, einfo.start, einfo.length);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user