Skip to content

Commit

Permalink
[media] lirc_zilog: Use kernel standard methods for marking device no…
Browse files Browse the repository at this point in the history
…n-seekable

lirc_zilog had its own llseek stub that returned -ESPIPE.  Get rid of
it and use the kernel's no_llseek() and nonseekable_open() functions
instead.

Signed-off-by: Andy Walls <awalls@md.metrocast.net>
Signed-off-by: Jarod Wilson <jarod@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Mar 22, 2011
1 parent a306485 commit 9a55a2b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions drivers/staging/lirc/lirc_zilog.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,12 +712,6 @@ static int tx_init(struct IR_tx *tx)
return 0;
}

/* do nothing stub to make LIRC happy */
static loff_t lseek(struct file *filep, loff_t offset, int orig)
{
return -ESPIPE;
}

/* copied from lirc_dev */
static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos)
{
Expand Down Expand Up @@ -1099,6 +1093,7 @@ static int open(struct inode *node, struct file *filep)
/* stash our IR struct */
filep->private_data = ir;

nonseekable_open(node, filep);
return 0;
}

Expand Down Expand Up @@ -1150,7 +1145,7 @@ static struct i2c_driver driver = {

static const struct file_operations lirc_fops = {
.owner = THIS_MODULE,
.llseek = lseek,
.llseek = no_llseek,
.read = read,
.write = write,
.poll = poll,
Expand Down

0 comments on commit 9a55a2b

Please sign in to comment.