Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138334
b: refs/heads/master
c: d2ff3ec
h: refs/heads/master
v: v3
  • Loading branch information
Janne Grunau authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent acfa12b commit e1b9f96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 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: a50ab29185a9ec31e5a6999e53add0508653e889
refs/heads/master: d2ff3ec81628cbf9470c496b3d0c0780165643f5
20 changes: 8 additions & 12 deletions trunk/drivers/media/video/hdpvr/hdpvr-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,7 @@ static ssize_t hdpvr_read(struct file *file, char __user *buffer, size_t count,

static unsigned int hdpvr_poll(struct file *filp, poll_table *wait)
{
struct hdpvr_buffer *buf = NULL;
struct hdpvr_fh *fh = (struct hdpvr_fh *)filp->private_data;
struct hdpvr_device *dev = fh->dev;
unsigned int mask = 0;
Expand All @@ -499,19 +500,14 @@ static unsigned int hdpvr_poll(struct file *filp, poll_table *wait)
}
mutex_unlock(&dev->io_mutex);

poll_wait(filp, &dev->wait_data, wait);

mutex_lock(&dev->io_mutex);
if (!list_empty(&dev->rec_buff_list)) {

struct hdpvr_buffer *buf = list_entry(dev->rec_buff_list.next,
struct hdpvr_buffer,
buff_list);

if (buf->status == BUFSTAT_READY)
mask |= POLLIN | POLLRDNORM;
buf = hdpvr_get_next_buffer(dev);
/* only wait if no data is available */
if (!buf || buf->status != BUFSTAT_READY) {
poll_wait(filp, &dev->wait_data, wait);
buf = hdpvr_get_next_buffer(dev);
}
mutex_unlock(&dev->io_mutex);
if (buf && buf->status == BUFSTAT_READY)
mask |= POLLIN | POLLRDNORM;

return mask;
}
Expand Down

0 comments on commit e1b9f96

Please sign in to comment.