[media] v4l2-core: do not enable the buffer ioctls for radio devices
The buffer ioctls (VIDIOC_REQBUFS, VIDIOC_QUERYBUF, VIDIOC_QBUF, VIDIOC_DQBUF, VIDIOC_EXPBUF, VIDIOC_CREATE_BUFS, VIDIOC_PREPARE_BUF) are not applicable for radio devices. Hence, they should be set valid only for non-radio devices in determine_valid_ioctls(). Signed-off-by: Frank Schäfer <fschaefer.oss@googlemail.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
248ac368ce
commit
5815d0c4d5
@ -568,11 +568,6 @@ static void determine_valid_ioctls(struct video_device *vdev)
|
||||
if (ops->vidioc_s_priority ||
|
||||
test_bit(V4L2_FL_USE_FH_PRIO, &vdev->flags))
|
||||
set_bit(_IOC_NR(VIDIOC_S_PRIORITY), valid_ioctls);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_REQBUFS, vidioc_reqbufs);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_QUERYBUF, vidioc_querybuf);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_QBUF, vidioc_qbuf);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_EXPBUF, vidioc_expbuf);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_DQBUF, vidioc_dqbuf);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_STREAMON, vidioc_streamon);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_STREAMOFF, vidioc_streamoff);
|
||||
/* Note: the control handler can also be passed through the filehandle,
|
||||
@ -605,8 +600,6 @@ static void determine_valid_ioctls(struct video_device *vdev)
|
||||
SET_VALID_IOCTL(ops, VIDIOC_DQEVENT, vidioc_subscribe_event);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_SUBSCRIBE_EVENT, vidioc_subscribe_event);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_UNSUBSCRIBE_EVENT, vidioc_unsubscribe_event);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_CREATE_BUFS, vidioc_create_bufs);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_PREPARE_BUF, vidioc_prepare_buf);
|
||||
if (ops->vidioc_enum_freq_bands || ops->vidioc_g_tuner || ops->vidioc_g_modulator)
|
||||
set_bit(_IOC_NR(VIDIOC_ENUM_FREQ_BANDS), valid_ioctls);
|
||||
|
||||
@ -672,6 +665,13 @@ static void determine_valid_ioctls(struct video_device *vdev)
|
||||
}
|
||||
if (!is_radio) {
|
||||
/* ioctls valid for video or vbi */
|
||||
SET_VALID_IOCTL(ops, VIDIOC_REQBUFS, vidioc_reqbufs);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_QUERYBUF, vidioc_querybuf);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_QBUF, vidioc_qbuf);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_EXPBUF, vidioc_expbuf);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_DQBUF, vidioc_dqbuf);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_CREATE_BUFS, vidioc_create_bufs);
|
||||
SET_VALID_IOCTL(ops, VIDIOC_PREPARE_BUF, vidioc_prepare_buf);
|
||||
if (ops->vidioc_s_std)
|
||||
set_bit(_IOC_NR(VIDIOC_ENUMSTD), valid_ioctls);
|
||||
if (ops->vidioc_g_std || vdev->current_norm)
|
||||
|
Loading…
Reference in New Issue
Block a user