aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-02-07 11:14:21 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-06-02 12:00:10 +0200
commitddf4bb58473a00fb164cdfe1abe49d2e70235037 (patch)
tree6dec69aa51b4fece882a515093d596d9e96f4508
parent83c6e74cae51811c89b6c5a9707422df6d693abd (diff)
bttv: improve epollpoll
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--drivers/media/pci/bt8xx/bttv-driver.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/media/pci/bt8xx/bttv-driver.c b/drivers/media/pci/bt8xx/bttv-driver.c
index 636e6a2549a9..d61c8ecc6698 100644
--- a/drivers/media/pci/bt8xx/bttv-driver.c
+++ b/drivers/media/pci/bt8xx/bttv-driver.c
@@ -2948,10 +2948,11 @@ static __poll_t bttv_poll(struct file *file, poll_table *wait)
__poll_t rc = 0;
__poll_t req_events = poll_requested_events(wait);
- if (v4l2_event_pending(&fh->fh))
- rc = EPOLLPRI;
- else if (req_events & EPOLLPRI)
+ if (req_events & EPOLLPRI) {
poll_wait(file, &fh->fh.wait, wait);
+ if (v4l2_event_pending(&fh->fh))
+ rc = EPOLLPRI;
+ }
if (!(req_events & (EPOLLIN | EPOLLRDNORM)))
return rc;
@@ -3322,10 +3323,11 @@ static __poll_t radio_poll(struct file *file, poll_table *wait)
struct saa6588_command cmd;
__poll_t res = 0;
- if (v4l2_event_pending(&fh->fh))
- res = EPOLLPRI;
- else if (req_events & EPOLLPRI)
+ if (req_events & EPOLLPRI) {
poll_wait(file, &fh->fh.wait, wait);
+ if (v4l2_event_pending(&fh->fh))
+ res = EPOLLPRI;
+ }
radio_enable(btv);
cmd.instance = file;
cmd.event_list = wait;

Privacy Policy