提交 1265f080 编写于 作者: H Hans Verkuil 提交者: Mauro Carvalho Chehab

[media] cx231xx: replace ioctl by unlocked_ioctl

There was already a core lock, so why wasn't ioctl already replaced by
unlock_ioctl?
This patch switches to unlocked_ioctl.
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 a25a7012
...@@ -1633,12 +1633,8 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int i) ...@@ -1633,12 +1633,8 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
dprintk(3, "enter vidioc_s_input() i=%d\n", i); dprintk(3, "enter vidioc_s_input() i=%d\n", i);
mutex_lock(&dev->lock);
video_mux(dev, i); video_mux(dev, i);
mutex_unlock(&dev->lock);
if (i >= 4) if (i >= 4)
return -EINVAL; return -EINVAL;
dev->input = i; dev->input = i;
...@@ -1932,7 +1928,8 @@ static int mpeg_open(struct file *file) ...@@ -1932,7 +1928,8 @@ static int mpeg_open(struct file *file)
if (dev == NULL) if (dev == NULL)
return -ENODEV; return -ENODEV;
mutex_lock(&dev->lock); if (mutex_lock_interruptible(&dev->lock))
return -ERESTARTSYS;
/* allocate + initialize per filehandle data */ /* allocate + initialize per filehandle data */
fh = kzalloc(sizeof(*fh), GFP_KERNEL); fh = kzalloc(sizeof(*fh), GFP_KERNEL);
...@@ -1948,14 +1945,14 @@ static int mpeg_open(struct file *file) ...@@ -1948,14 +1945,14 @@ static int mpeg_open(struct file *file)
videobuf_queue_vmalloc_init(&fh->vidq, &cx231xx_qops, videobuf_queue_vmalloc_init(&fh->vidq, &cx231xx_qops,
NULL, &dev->video_mode.slock, NULL, &dev->video_mode.slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_INTERLACED, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_INTERLACED,
sizeof(struct cx231xx_buffer), fh, NULL); sizeof(struct cx231xx_buffer), fh, &dev->lock);
/* /*
videobuf_queue_sg_init(&fh->vidq, &cx231xx_qops, videobuf_queue_sg_init(&fh->vidq, &cx231xx_qops,
&dev->udev->dev, &dev->ts1.slock, &dev->udev->dev, &dev->ts1.slock,
V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_BUF_TYPE_VIDEO_CAPTURE,
V4L2_FIELD_INTERLACED, V4L2_FIELD_INTERLACED,
sizeof(struct cx231xx_buffer), sizeof(struct cx231xx_buffer),
fh, NULL); fh, &dev->lock);
*/ */
...@@ -2069,7 +2066,7 @@ static struct v4l2_file_operations mpeg_fops = { ...@@ -2069,7 +2066,7 @@ static struct v4l2_file_operations mpeg_fops = {
.read = mpeg_read, .read = mpeg_read,
.poll = mpeg_poll, .poll = mpeg_poll,
.mmap = mpeg_mmap, .mmap = mpeg_mmap,
.ioctl = video_ioctl2, .unlocked_ioctl = video_ioctl2,
}; };
static const struct v4l2_ioctl_ops mpeg_ioctl_ops = { static const struct v4l2_ioctl_ops mpeg_ioctl_ops = {
...@@ -2144,11 +2141,11 @@ static struct video_device *cx231xx_video_dev_alloc( ...@@ -2144,11 +2141,11 @@ static struct video_device *cx231xx_video_dev_alloc(
if (NULL == vfd) if (NULL == vfd)
return NULL; return NULL;
*vfd = *template; *vfd = *template;
vfd->minor = -1;
snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name, snprintf(vfd->name, sizeof(vfd->name), "%s %s (%s)", dev->name,
type, cx231xx_boards[dev->model].name); type, cx231xx_boards[dev->model].name);
vfd->v4l2_dev = &dev->v4l2_dev; vfd->v4l2_dev = &dev->v4l2_dev;
vfd->lock = &dev->lock;
vfd->release = video_device_release; vfd->release = video_device_release;
return vfd; return vfd;
......
...@@ -2237,7 +2237,7 @@ static const struct v4l2_file_operations radio_fops = { ...@@ -2237,7 +2237,7 @@ static const struct v4l2_file_operations radio_fops = {
.open = cx231xx_v4l2_open, .open = cx231xx_v4l2_open,
.release = cx231xx_v4l2_close, .release = cx231xx_v4l2_close,
.poll = v4l2_ctrl_poll, .poll = v4l2_ctrl_poll,
.ioctl = video_ioctl2, .unlocked_ioctl = video_ioctl2,
}; };
static const struct v4l2_ioctl_ops radio_ioctl_ops = { static const struct v4l2_ioctl_ops radio_ioctl_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册