aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdchar.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2011-12-30 10:00:35 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2012-01-09 13:26:22 -0500
commit381345652fca688aeaa967c231e5075cf68d05b6 (patch)
tree5f23ecdd28165d15109c6fd7ad0c4c573f094707 /drivers/mtd/mtdchar.c
parent327cf2922b4edf0439b219469722d2a502e37349 (diff)
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>
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-rw-r--r--drivers/mtd/mtdchar.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 23a51104aeb5..92da621b1425 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -814,10 +814,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
814 if (copy_from_user(&einfo, argp, sizeof(einfo))) 814 if (copy_from_user(&einfo, argp, sizeof(einfo)))
815 return -EFAULT; 815 return -EFAULT;
816 816
817 if (!mtd->lock) 817 ret = mtd_lock(mtd, einfo.start, einfo.length);
818 ret = -EOPNOTSUPP;
819 else
820 ret = mtd_lock(mtd, einfo.start, einfo.length);
821 break; 818 break;
822 } 819 }
823 820
@@ -828,10 +825,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
828 if (copy_from_user(&einfo, argp, sizeof(einfo))) 825 if (copy_from_user(&einfo, argp, sizeof(einfo)))
829 return -EFAULT; 826 return -EFAULT;
830 827
831 if (!mtd->unlock) 828 ret = mtd_unlock(mtd, einfo.start, einfo.length);
832 ret = -EOPNOTSUPP;
833 else
834 ret = mtd_unlock(mtd, einfo.start, einfo.length);
835 break; 829 break;
836 } 830 }
837 831
@@ -842,10 +836,7 @@ static int mtdchar_ioctl(struct file *file, u_int cmd, u_long arg)
842 if (copy_from_user(&einfo, argp, sizeof(einfo))) 836 if (copy_from_user(&einfo, argp, sizeof(einfo)))
843 return -EFAULT; 837 return -EFAULT;
844 838
845 if (!mtd->is_locked) 839 ret = mtd_is_locked(mtd, einfo.start, einfo.length);
846 ret = -EOPNOTSUPP;
847 else
848 ret = mtd_is_locked(mtd, einfo.start, einfo.length);
849 break; 840 break;
850 } 841 }
851 842