Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242158
b: refs/heads/master
c: 915e547
h: refs/heads/master
v: v3
  • Loading branch information
Andy Walls authored and Mauro Carvalho Chehab committed Mar 22, 2011
1 parent fb4e811 commit bdf8706
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9a55a2b37eb7e4941ef55aadb858b615d229afee
refs/heads/master: 915e54733de4a36742ab78b4768750ce72662f85
21 changes: 14 additions & 7 deletions trunk/drivers/staging/lirc/lirc_zilog.c
Original file line number Diff line number Diff line change
Expand Up @@ -985,19 +985,26 @@ static unsigned int poll(struct file *filep, poll_table *wait)
unsigned int ret;

dprintk("poll called\n");
if (rx == NULL)
return -ENODEV;

mutex_lock(&rx->buf_lock);
if (rx == NULL) {
/*
* Revisit this, if our poll function ever reports writeable
* status for Tx
*/
dprintk("poll result = POLLERR\n");
return POLLERR;
}

/*
* Add our lirc_buffer's wait_queue to the poll_table. A wake up on
* that buffer's wait queue indicates we may have a new poll status.
*/
poll_wait(filep, &rx->buf.wait_poll, wait);

dprintk("poll result = %s\n",
lirc_buffer_empty(&rx->buf) ? "0" : "POLLIN|POLLRDNORM");

/* Indicate what ops could happen immediately without blocking */
ret = lirc_buffer_empty(&rx->buf) ? 0 : (POLLIN|POLLRDNORM);

mutex_unlock(&rx->buf_lock);
dprintk("poll result = %s\n", ret ? "POLLIN|POLLRDNORM" : "none");
return ret;
}

Expand Down

0 comments on commit bdf8706

Please sign in to comment.