lirc: make chardev nonseekable
authorArnd Bergmann <arnd@arndb.de>
Sun, 15 Aug 2010 16:51:56 +0000 (18:51 +0200)
committerArnd Bergmann <arnd@arndb.de>
Thu, 16 Sep 2010 08:33:16 +0000 (10:33 +0200)
There does not seem to be a need for lirc to
allow seeking on the file descriptor, so let's
just disallow this before users start relying
on it.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/media/IR/ir-lirc-codec.c
drivers/media/IR/lirc_dev.c
drivers/staging/lirc/lirc_serial.c
drivers/staging/lirc/lirc_sir.c

index 77b5946..8a12893 100644 (file)
@@ -235,6 +235,7 @@ static struct file_operations lirc_fops = {
        .poll           = lirc_dev_fop_poll,
        .open           = lirc_dev_fop_open,
        .release        = lirc_dev_fop_close,
+       .llseek         = no_llseek,
 };
 
 static int ir_lirc_register(struct input_dev *input_dev)
index 899891b..5b145e8 100644 (file)
@@ -460,6 +460,8 @@ error:
 
        mutex_unlock(&lirc_dev_lock);
 
+       nonseekable_open(inode, file);
+
        return retval;
 }
 EXPORT_SYMBOL(lirc_dev_fop_open);
index 9456f8e..8da3824 100644 (file)
@@ -1058,6 +1058,7 @@ static const struct file_operations lirc_fops = {
        .poll           = lirc_dev_fop_poll,
        .open           = lirc_dev_fop_open,
        .release        = lirc_dev_fop_close,
+       .llseek         = no_llseek,
 };
 
 static struct lirc_driver driver = {
index eb08fa7..2478871 100644 (file)
@@ -459,6 +459,7 @@ static const struct file_operations lirc_fops = {
        .unlocked_ioctl = lirc_ioctl,
        .open           = lirc_dev_fop_open,
        .release        = lirc_dev_fop_close,
+       .llseek         = no_llseek,
 };
 
 static int set_use_inc(void *data)