summaryrefslogtreecommitdiff
path: root/drivers/mtd/mtdchar.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2013-06-16 20:27:42 +0400
committerAl Viro <viro@zeniv.linux.org.uk>2013-06-29 12:57:27 +0400
commitb959957f9428b05cd5e138beebee04897bfd673d (patch)
treeb442b575d92ddf2ec139c8a7d480cc8514ce374c /drivers/mtd/mtdchar.c
parent1bf9d14dff4a2c4de6152c6f751bdaf6896b68bb (diff)
downloadlinux-b959957f9428b05cd5e138beebee04897bfd673d.tar.xz
mtdchar: switch to fixed_size_llseek()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/mtd/mtdchar.c')
-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 {
static loff_t mtdchar_lseek(struct file *file, loff_t offset, int orig)
{
struct mtd_file_info *mfi = file->private_data;
- struct mtd_info *mtd = mfi->mtd;
-
- switch (orig) {
- case SEEK_SET:
- break;
- case SEEK_CUR:
- offset += file->f_pos;
- break;
- case SEEK_END:
- offset += mtd->size;
- break;
- default:
- return -EINVAL;
- }
-
- if (offset >= 0 && offset <= mtd->size)
- return file->f_pos = offset;
-
- return -EINVAL;
+ return fixed_size_llseek(file, offset, orig, mfi->mtd->size);
}
static int count;