Source
93
93
static __poll_t media_request_poll(struct file *filp,
94
94
struct poll_table_struct *wait)
95
95
{
96
96
struct media_request *req = filp->private_data;
97
97
unsigned long flags;
98
98
__poll_t ret = 0;
99
99
100
100
if (!(poll_requested_events(wait) & EPOLLPRI))
101
101
return 0;
102
102
103
+
poll_wait(filp, &req->poll_wait, wait);
103
104
spin_lock_irqsave(&req->lock, flags);
104
105
if (req->state == MEDIA_REQUEST_STATE_COMPLETE) {
105
106
ret = EPOLLPRI;
106
107
goto unlock;
107
108
}
108
109
if (req->state != MEDIA_REQUEST_STATE_QUEUED) {
109
110
ret = EPOLLERR;
110
111
goto unlock;
111
112
}
112
113
113
-
poll_wait(filp, &req->poll_wait, wait);
114
-
115
114
unlock:
116
115
spin_unlock_irqrestore(&req->lock, flags);
117
116
return ret;
118
117
}
119
118
120
119
static long media_request_ioctl_queue(struct media_request *req)
121
120
{
122
121
struct media_device *mdev = req->mdev;
123
122
enum media_request_state state;
124
123
unsigned long flags;