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 77b5946413c0203739d9bdcecb129e218f194356..8a128934e60568829a1a8335cc2b4b1bd93c395b 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 899891bec352a3f20fd00975e8cadfacce4da9c7..5b145e8672fea0d561a27f00d68db1c76998d943 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 9456f8e3f9ef37f75b71a1146ea2e1199c851fd0..8da38249261295273dc609535c069dc399157331 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 eb08fa7138bab4418ba5a4ae8d40022c6eb5e406..2478871bd95efbedd72f7e09b7f6cb451ecf0f0b 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)