diff options
author | Dyks, Axel (XL) <xl@xlsigned.net> | 2006-06-11 16:14:35 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 01:05:07 -0400 |
commit | 774dd5d9bdcbfe2efb3425e8a0be0b4d01a65c26 (patch) | |
tree | 61d89fd4b4e952d9d5aa9f62a24371ff78b9641c /drivers/media/dvb/cinergyT2 | |
parent | be4f451975c6514a9e12451c2ae2ce91d5673b06 (diff) |
V4L/DVB (4090): Fix cinergyt2_poll() to allow non-blocking IO on frontend
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>
Diffstat (limited to 'drivers/media/dvb/cinergyT2')
-rw-r--r-- | drivers/media/dvb/cinergyT2/cinergyT2.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/dvb/cinergyT2/cinergyT2.c b/drivers/media/dvb/cinergyT2/cinergyT2.c index c7e4134872d4..8cfdad6f50fb 100644 --- a/drivers/media/dvb/cinergyT2/cinergyT2.c +++ b/drivers/media/dvb/cinergyT2/cinergyT2.c | |||
@@ -544,15 +544,19 @@ static unsigned int cinergyt2_poll (struct file *file, struct poll_table_struct | |||
544 | { | 544 | { |
545 | struct dvb_device *dvbdev = file->private_data; | 545 | struct dvb_device *dvbdev = file->private_data; |
546 | struct cinergyt2 *cinergyt2 = dvbdev->priv; | 546 | struct cinergyt2 *cinergyt2 = dvbdev->priv; |
547 | unsigned int mask = 0; | ||
547 | 548 | ||
548 | if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem)) | 549 | if (cinergyt2->disconnect_pending || mutex_lock_interruptible(&cinergyt2->sem)) |
549 | return -ERESTARTSYS; | 550 | return -ERESTARTSYS; |
550 | 551 | ||
551 | poll_wait(file, &cinergyt2->poll_wq, wait); | 552 | poll_wait(file, &cinergyt2->poll_wq, wait); |
552 | 553 | ||
554 | if (cinergyt2->pending_fe_events != 0) | ||
555 | mask |= (POLLIN | POLLRDNORM | POLLPRI); | ||
556 | |||
553 | mutex_unlock(&cinergyt2->sem); | 557 | mutex_unlock(&cinergyt2->sem); |
554 | 558 | ||
555 | return (POLLIN | POLLRDNORM | POLLPRI); | 559 | return mask; |
556 | } | 560 | } |
557 | 561 | ||
558 | 562 | ||