Skip to content

Commit b959957

Browse files
author
Al Viro
committed
mtdchar: switch to fixed_size_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 1bf9d14 commit b959957

1 file changed

Lines changed: 1 addition & 19 deletions

File tree

‎drivers/mtd/mtdchar.c‎

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,7 @@ struct mtd_file_info {
5555
static loff_t mtdchar_lseek(struct file *file, loff_t offset, int orig)
5656
{
5757
struct mtd_file_info *mfi = file->private_data;
58-
struct mtd_info *mtd = mfi->mtd;
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;
58+
return fixed_size_llseek(file, offset, orig, mfi->mtd->size);
7759
}
7860

7961
static int count;

0 commit comments

Comments
 (0)