Skip to content

Commit

Permalink
media: annotate ->poll() instances
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Nov 27, 2017
1 parent 076ccb7 commit c23e0cb
Show file tree
Hide file tree
Showing 80 changed files with 143 additions and 147 deletions.
4 changes: 2 additions & 2 deletions drivers/media/cec/cec-api.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ static inline struct cec_devnode *cec_devnode_data(struct file *filp)

/* CEC file operations */

static unsigned int cec_poll(struct file *filp,
static __poll_t cec_poll(struct file *filp,
struct poll_table_struct *poll)
{
struct cec_devnode *devnode = cec_devnode_data(filp);
struct cec_fh *fh = filp->private_data;
struct cec_adapter *adap = fh->adap;
unsigned int res = 0;
__poll_t res = 0;

if (!devnode->registered)
return POLLERR | POLLHUP;
Expand Down
8 changes: 4 additions & 4 deletions drivers/media/common/saa7146/saa7146_fops.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,13 @@ static int fops_mmap(struct file *file, struct vm_area_struct * vma)
return res;
}

static unsigned int __fops_poll(struct file *file, struct poll_table_struct *wait)
static __poll_t __fops_poll(struct file *file, struct poll_table_struct *wait)
{
struct video_device *vdev = video_devdata(file);
struct saa7146_fh *fh = file->private_data;
struct videobuf_buffer *buf = NULL;
struct videobuf_queue *q;
unsigned int res = v4l2_ctrl_poll(file, wait);
__poll_t res = v4l2_ctrl_poll(file, wait);

DEB_EE("file:%p, poll:%p\n", file, wait);

Expand Down Expand Up @@ -359,10 +359,10 @@ static unsigned int __fops_poll(struct file *file, struct poll_table_struct *wai
return res;
}

static unsigned int fops_poll(struct file *file, struct poll_table_struct *wait)
static __poll_t fops_poll(struct file *file, struct poll_table_struct *wait)
{
struct video_device *vdev = video_devdata(file);
unsigned int res;
__poll_t res;

mutex_lock(vdev->lock);
res = __fops_poll(file, wait);
Expand Down
7 changes: 2 additions & 5 deletions drivers/media/common/siano/smsdvb-debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ static int smsdvb_stats_wait_read(struct smsdvb_debugfs *debug_data)
return rc;
}

static unsigned int smsdvb_stats_poll(struct file *file, poll_table *wait)
static __poll_t smsdvb_stats_poll(struct file *file, poll_table *wait)
{
struct smsdvb_debugfs *debug_data = file->private_data;
int rc;
Expand All @@ -384,12 +384,9 @@ static unsigned int smsdvb_stats_poll(struct file *file, poll_table *wait)
poll_wait(file, &debug_data->stats_queue, wait);

rc = smsdvb_stats_wait_read(debug_data);
if (rc > 0)
rc = POLLIN | POLLRDNORM;

kref_put(&debug_data->refcount, smsdvb_debugfs_data_release);

return rc;
return rc > 0 ? POLLIN | POLLRDNORM : 0;
}

static ssize_t smsdvb_stats_read(struct file *file, char __user *user_buf,
Expand Down
8 changes: 4 additions & 4 deletions drivers/media/dvb-core/dmxdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,10 +1066,10 @@ static long dvb_demux_ioctl(struct file *file, unsigned int cmd,
return dvb_usercopy(file, cmd, arg, dvb_demux_do_ioctl);
}

static unsigned int dvb_demux_poll(struct file *file, poll_table *wait)
static __poll_t dvb_demux_poll(struct file *file, poll_table *wait)
{
struct dmxdev_filter *dmxdevfilter = file->private_data;
unsigned int mask = 0;
__poll_t mask = 0;

if ((!dmxdevfilter) || dmxdevfilter->dev->exit)
return POLLERR;
Expand Down Expand Up @@ -1160,11 +1160,11 @@ static long dvb_dvr_ioctl(struct file *file,
return dvb_usercopy(file, cmd, arg, dvb_dvr_do_ioctl);
}

static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait)
static __poll_t dvb_dvr_poll(struct file *file, poll_table *wait)
{
struct dvb_device *dvbdev = file->private_data;
struct dmxdev *dmxdev = dvbdev->priv;
unsigned int mask = 0;
__poll_t mask = 0;

dprintk("%s\n", __func__);

Expand Down
4 changes: 2 additions & 2 deletions drivers/media/dvb-core/dvb_ca_en50221.c
Original file line number Diff line number Diff line change
Expand Up @@ -1783,11 +1783,11 @@ static int dvb_ca_en50221_io_release(struct inode *inode, struct file *file)
*
* @return Standard poll mask.
*/
static unsigned int dvb_ca_en50221_io_poll(struct file *file, poll_table *wait)
static __poll_t dvb_ca_en50221_io_poll(struct file *file, poll_table *wait)
{
struct dvb_device *dvbdev = file->private_data;
struct dvb_ca_private *ca = dvbdev->priv;
unsigned int mask = 0;
__poll_t mask = 0;
int slot;
int result = 0;

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb-core/dvb_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -2467,7 +2467,7 @@ static int dvb_frontend_handle_ioctl(struct file *file,
}


static unsigned int dvb_frontend_poll(struct file *file, struct poll_table_struct *wait)
static __poll_t dvb_frontend_poll(struct file *file, struct poll_table_struct *wait)
{
struct dvb_device *dvbdev = file->private_data;
struct dvb_frontend *fe = dvbdev->priv;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/firewire/firedtv-ci.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ static int fdtv_ca_ioctl(struct file *file, unsigned int cmd, void *arg)
return err;
}

static unsigned int fdtv_ca_io_poll(struct file *file, poll_table *wait)
static __poll_t fdtv_ca_io_poll(struct file *file, poll_table *wait)
{
return POLLIN;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/media-devnode.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static ssize_t media_write(struct file *filp, const char __user *buf,
return devnode->fops->write(filp, buf, sz, off);
}

static unsigned int media_poll(struct file *filp,
static __poll_t media_poll(struct file *filp,
struct poll_table_struct *poll)
{
struct media_devnode *devnode = media_devnode_data(filp);
Expand Down
8 changes: 4 additions & 4 deletions drivers/media/pci/bt8xx/bttv-driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2955,12 +2955,12 @@ static ssize_t bttv_read(struct file *file, char __user *data,
return retval;
}

static unsigned int bttv_poll(struct file *file, poll_table *wait)
static __poll_t bttv_poll(struct file *file, poll_table *wait)
{
struct bttv_fh *fh = file->private_data;
struct bttv_buffer *buf;
enum v4l2_field field;
unsigned int rc = 0;
__poll_t rc = 0;
__poll_t req_events = poll_requested_events(wait);

if (v4l2_event_pending(&fh->fh))
Expand Down Expand Up @@ -3329,13 +3329,13 @@ static ssize_t radio_read(struct file *file, char __user *data,
return cmd.result;
}

static unsigned int radio_poll(struct file *file, poll_table *wait)
static __poll_t radio_poll(struct file *file, poll_table *wait)
{
struct bttv_fh *fh = file->private_data;
struct bttv *btv = fh->btv;
__poll_t req_events = poll_requested_events(wait);
struct saa6588_command cmd;
unsigned int res = 0;
__poll_t res = 0;

if (v4l2_event_pending(&fh->fh))
res = POLLPRI;
Expand Down
6 changes: 3 additions & 3 deletions drivers/media/pci/cx18/cx18-fileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -602,14 +602,14 @@ ssize_t cx18_v4l2_read(struct file *filp, char __user *buf, size_t count,
return cx18_read_pos(s, buf, count, pos, filp->f_flags & O_NONBLOCK);
}

unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
__poll_t cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)
{
__poll_t req_events = poll_requested_events(wait);
struct cx18_open_id *id = file2id(filp);
struct cx18 *cx = id->cx;
struct cx18_stream *s = &cx->streams[id->type];
int eof = test_bit(CX18_F_S_STREAMOFF, &s->s_flags);
unsigned res = 0;
__poll_t res = 0;

/* Start a capture if there is none */
if (!eof && !test_bit(CX18_F_S_STREAMING, &s->s_flags) &&
Expand All @@ -629,7 +629,7 @@ unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait)

if ((s->vb_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) &&
(id->type == CX18_ENC_STREAM_TYPE_YUV)) {
int videobuf_poll = videobuf_poll_stream(filp, &s->vbuf_q, wait);
__poll_t videobuf_poll = videobuf_poll_stream(filp, &s->vbuf_q, wait);

if (v4l2_event_pending(&id->fh))
res |= POLLPRI;
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/pci/cx18/cx18-fileops.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ssize_t cx18_v4l2_read(struct file *filp, char __user *buf, size_t count,
ssize_t cx18_v4l2_write(struct file *filp, const char __user *buf, size_t count,
loff_t *pos);
int cx18_v4l2_close(struct file *filp);
unsigned int cx18_v4l2_enc_poll(struct file *filp, poll_table *wait);
__poll_t cx18_v4l2_enc_poll(struct file *filp, poll_table *wait);
int cx18_start_capture(struct cx18_open_id *id);
void cx18_stop_capture(struct cx18_open_id *id, int gop_end);
void cx18_mute(struct cx18 *cx);
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/ddbridge/ddbridge-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,13 +732,13 @@ static ssize_t ts_read(struct file *file, __user char *buf,
return (count && (left == count)) ? -EAGAIN : (count - left);
}

static unsigned int ts_poll(struct file *file, poll_table *wait)
static __poll_t ts_poll(struct file *file, poll_table *wait)
{
struct dvb_device *dvbdev = file->private_data;
struct ddb_output *output = dvbdev->priv;
struct ddb_input *input = output->port->input[0];

unsigned int mask = 0;
__poll_t mask = 0;

poll_wait(file, &input->dma->wq, wait);
poll_wait(file, &output->dma->wq, wait);
Expand Down
8 changes: 4 additions & 4 deletions drivers/media/pci/ivtv/ivtv-fileops.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,12 +730,12 @@ ssize_t ivtv_v4l2_write(struct file *filp, const char __user *user_buf, size_t c
return res;
}

unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
__poll_t ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
{
struct ivtv_open_id *id = fh2id(filp->private_data);
struct ivtv *itv = id->itv;
struct ivtv_stream *s = &itv->streams[id->type];
int res = 0;
__poll_t res = 0;

/* add stream's waitq to the poll list */
IVTV_DEBUG_HI_FILE("Decoder poll\n");
Expand Down Expand Up @@ -764,14 +764,14 @@ unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table *wait)
return res;
}

unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
__poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table *wait)
{
__poll_t req_events = poll_requested_events(wait);
struct ivtv_open_id *id = fh2id(filp->private_data);
struct ivtv *itv = id->itv;
struct ivtv_stream *s = &itv->streams[id->type];
int eof = test_bit(IVTV_F_S_STREAMOFF, &s->s_flags);
unsigned res = 0;
__poll_t res = 0;

/* Start a capture if there is none */
if (!eof && !test_bit(IVTV_F_S_STREAMING, &s->s_flags) &&
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/ivtv/ivtv-fileops.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ ssize_t ivtv_v4l2_read(struct file *filp, char __user *buf, size_t count,
ssize_t ivtv_v4l2_write(struct file *filp, const char __user *buf, size_t count,
loff_t * pos);
int ivtv_v4l2_close(struct file *filp);
unsigned int ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait);
unsigned int ivtv_v4l2_dec_poll(struct file *filp, poll_table * wait);
__poll_t ivtv_v4l2_enc_poll(struct file *filp, poll_table * wait);
__poll_t ivtv_v4l2_dec_poll(struct file *filp, poll_table * wait);
int ivtv_start_capture(struct ivtv_open_id *id);
void ivtv_stop_capture(struct ivtv_open_id *id, int gop_end);
int ivtv_start_decoding(struct ivtv_open_id *id, int speed);
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/meye/meye.c
Original file line number Diff line number Diff line change
Expand Up @@ -1423,9 +1423,9 @@ static long vidioc_default(struct file *file, void *fh, bool valid_prio,

}

static unsigned int meye_poll(struct file *file, poll_table *wait)
static __poll_t meye_poll(struct file *file, poll_table *wait)
{
unsigned int res = v4l2_ctrl_poll(file, wait);
__poll_t res = v4l2_ctrl_poll(file, wait);

mutex_lock(&meye.lock);
poll_wait(file, &meye.proc_list, wait);
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/saa7134/saa7134-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,11 +1227,11 @@ static ssize_t radio_read(struct file *file, char __user *data,
return cmd.result;
}

static unsigned int radio_poll(struct file *file, poll_table *wait)
static __poll_t radio_poll(struct file *file, poll_table *wait)
{
struct saa7134_dev *dev = video_drvdata(file);
struct saa6588_command cmd;
unsigned int rc = v4l2_ctrl_poll(file, wait);
__poll_t rc = v4l2_ctrl_poll(file, wait);

cmd.instance = file;
cmd.event_list = wait;
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/saa7164/saa7164-encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -909,13 +909,13 @@ static ssize_t fops_read(struct file *file, char __user *buffer,
return ret;
}

static unsigned int fops_poll(struct file *file, poll_table *wait)
static __poll_t fops_poll(struct file *file, poll_table *wait)
{
__poll_t req_events = poll_requested_events(wait);
struct saa7164_encoder_fh *fh =
(struct saa7164_encoder_fh *)file->private_data;
struct saa7164_port *port = fh->port;
unsigned int mask = v4l2_ctrl_poll(file, wait);
__poll_t mask = v4l2_ctrl_poll(file, wait);

port->last_poll_msecs_diff = port->last_poll_msecs;
port->last_poll_msecs = jiffies_to_msecs(jiffies);
Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/saa7164/saa7164-vbi.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,11 +614,11 @@ static ssize_t fops_read(struct file *file, char __user *buffer,
return ret;
}

static unsigned int fops_poll(struct file *file, poll_table *wait)
static __poll_t fops_poll(struct file *file, poll_table *wait)
{
struct saa7164_vbi_fh *fh = (struct saa7164_vbi_fh *)file->private_data;
struct saa7164_port *port = fh->port;
unsigned int mask = 0;
__poll_t mask = 0;

port->last_poll_msecs_diff = port->last_poll_msecs;
port->last_poll_msecs = jiffies_to_msecs(jiffies);
Expand Down
8 changes: 4 additions & 4 deletions drivers/media/pci/ttpci/av7110_av.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,11 +937,11 @@ static int dvb_video_get_event (struct av7110 *av7110, struct video_event *event
* DVB device file operations
******************************************************************************/

static unsigned int dvb_video_poll(struct file *file, poll_table *wait)
static __poll_t dvb_video_poll(struct file *file, poll_table *wait)
{
struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = dvbdev->priv;
unsigned int mask = 0;
__poll_t mask = 0;

dprintk(2, "av7110:%p, \n", av7110);

Expand Down Expand Up @@ -989,11 +989,11 @@ static ssize_t dvb_video_write(struct file *file, const char __user *buf,
return dvb_play(av7110, buf, count, file->f_flags & O_NONBLOCK, 1);
}

static unsigned int dvb_audio_poll(struct file *file, poll_table *wait)
static __poll_t dvb_audio_poll(struct file *file, poll_table *wait)
{
struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = dvbdev->priv;
unsigned int mask = 0;
__poll_t mask = 0;

dprintk(2, "av7110:%p, \n", av7110);

Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/ttpci/av7110_ca.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,13 +223,13 @@ static int dvb_ca_open(struct inode *inode, struct file *file)
return 0;
}

static unsigned int dvb_ca_poll (struct file *file, poll_table *wait)
static __poll_t dvb_ca_poll (struct file *file, poll_table *wait)
{
struct dvb_device *dvbdev = file->private_data;
struct av7110 *av7110 = dvbdev->priv;
struct dvb_ringbuffer *rbuf = &av7110->ci_rbuffer;
struct dvb_ringbuffer *wbuf = &av7110->ci_wbuffer;
unsigned int mask = 0;
__poll_t mask = 0;

dprintk(8, "av7110:%p\n",av7110);

Expand Down
4 changes: 2 additions & 2 deletions drivers/media/pci/zoran/zoran_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2501,13 +2501,13 @@ static int zoran_s_jpegcomp(struct file *file, void *__fh,
return res;
}

static unsigned int
static __poll_t
zoran_poll (struct file *file,
poll_table *wait)
{
struct zoran_fh *fh = file->private_data;
struct zoran *zr = fh->zr;
int res = v4l2_ctrl_poll(file, wait);
__poll_t res = v4l2_ctrl_poll(file, wait);
int frame;
unsigned long flags;

Expand Down
2 changes: 1 addition & 1 deletion drivers/media/platform/davinci/vpfe_capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ static int vpfe_mmap(struct file *file, struct vm_area_struct *vma)
/*
* vpfe_poll: It is used for select/poll system call
*/
static unsigned int vpfe_poll(struct file *file, poll_table *wait)
static __poll_t vpfe_poll(struct file *file, poll_table *wait)
{
struct vpfe_device *vpfe_dev = video_drvdata(file);

Expand Down
Loading

0 comments on commit c23e0cb

Please sign in to comment.