Skip to content

Commit

Permalink
V4L/DVB (4090): Fix cinergyt2_poll() to allow non-blocking IO on fron…
Browse files Browse the repository at this point in the history
…tend

cinergyt2_poll()" shouldn't return (POLLIN | POLLRDNORM | POLLPRI) when
there are no pending events. User space programs that do non-bocking IO
using "select()" and/or "poll()" would otherwise produce high system load.
Acked-by: Andreas Oberritter <obi@linuxtv.org>

Signed-off-by: Axel Dyks <xl@xlsigned.net>
Acked-by: Andreas Oberritter <obi@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Dyks, Axel (XL) authored and Mauro Carvalho Chehab committed Jun 25, 2006
1 parent be4f451 commit 774dd5d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/media/dvb/cinergyT2/cinergyT2.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,15 +544,19 @@ static unsigned int cinergyt2_poll (struct file *file, struct poll_table_struct
{
struct dvb_device *dvbdev = file->private_data;
struct cinergyt2 *cinergyt2 = dvbdev->priv;
unsigned int mask = 0;

if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem))
return -ERESTARTSYS;

poll_wait(file, &cinergyt2->poll_wq, wait);

if (cinergyt2->pending_fe_events != 0)
mask |= (POLLIN | POLLRDNORM | POLLPRI);

mutex_unlock(&cinergyt2->sem);

return (POLLIN | POLLRDNORM | POLLPRI);
return mask;
}


Expand Down

0 comments on commit 774dd5d

Please sign in to comment.