aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-06-16 12:27:42 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 04:57:27 -0400
commitb959957f9428b05cd5e138beebee04897bfd673d (patch)
treeb442b575d92ddf2ec139c8a7d480cc8514ce374c /drivers/mtd
parent1bf9d14dff4a2c4de6152c6f751bdaf6896b68bb (diff)
mtdchar: switch to fixed_size_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/mtdchar.c20
1 files changed, 1 insertions, 19 deletions
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index c719879284bd..684bfa39e4ee 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -55,25 +55,7 @@ struct mtd_file_info {
55static loff_t mtdchar_lseek(struct file *file, loff_t offset, int orig) 55static loff_t mtdchar_lseek(struct file *file, loff_t offset, int orig)
56{ 56{
57 struct mtd_file_info *mfi = file->private_data; 57 struct mtd_file_info *mfi = file->private_data;
58 struct mtd_info *mtd = mfi->mtd; 58 return fixed_size_llseek(file, offset, orig, mfi->mtd->size);
59
60 switch (orig) {
61 case SEEK_SET:
62 break;
63 case SEEK_CUR:
64 offset += file->f_pos;
65 break;
66 case SEEK_END:
67 offset += mtd->size;
68 break;
69 default:
70 return -EINVAL;
71 }
72
73 if (offset >= 0 && offset <= mtd->size)
74 return file->f_pos = offset;
75
76 return -EINVAL;
77} 59}
78 60
79static int count; 61static int count;