Staging: use llseek in all file operations
authorArnd Bergmann <arnd@arndb.de>
Wed, 7 Jul 2010 21:40:09 +0000 (23:40 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 8 Jul 2010 20:57:58 +0000 (13:57 -0700)
These could not be detected by the semantic patch.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/staging/msm/mdp4_debugfs.c
drivers/staging/panel/panel.c

index 844d46775ecd3cfa630b9ad8c88cfcdc1c95442b..36954e89478c78cd7f8872ec86fe3eac069aeeb7 100644 (file)
@@ -63,13 +63,6 @@ DEFINE_SIMPLE_ATTRIBUTE(
                        "%llx\n");
 
 
-static int mdp4_debugfs_open(struct inode *inode, struct file *file)
-{
-       /* non-seekable */
-       file->f_mode &= ~(FMODE_LSEEK | FMODE_PREAD | FMODE_PWRITE);
-       return 0;
-}
-
 static int mdp4_debugfs_release(struct inode *inode, struct file *file)
 {
        return 0;
@@ -144,10 +137,11 @@ static ssize_t mdp4_debugfs_read(
 }
 
 static const struct file_operations mdp4_debugfs_fops = {
-       .open = mdp4_debugfs_open,
+       .open = nonseekable_open,
        .release = mdp4_debugfs_release,
        .read = mdp4_debugfs_read,
        .write = mdp4_debugfs_write,
+       .llseek = no_llseek,
 };
 
 int mdp4_debugfs_init(void)
index 6fa57beeccb53763485e4269740415d30c491393..8bd7182195b399c82300d5f8e52afe8e42088fc4 100644 (file)
@@ -1356,7 +1356,7 @@ static int lcd_open(struct inode *inode, struct file *file)
                lcd_must_clear = 0;
        }
        lcd_open_cnt++;
-       return 0;
+       return nonseekable_open(inode, file);
 }
 
 static int lcd_release(struct inode *inode, struct file *file)
@@ -1369,6 +1369,7 @@ static const struct file_operations lcd_fops = {
        .write   = lcd_write,
        .open    = lcd_open,
        .release = lcd_release,
+       .llseek  = no_llseek,
 };
 
 static struct miscdevice lcd_dev = {