diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-09 15:43:40 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-10-20 23:16:58 -0400 |
commit | 7242063018c06977dc6825026b3075076e6f227b (patch) | |
tree | 3d1a33e60443774cf5199c6bc6ee4b76f4d57ac3 /drivers/media/video/v4l2-dev.c | |
parent | be737a826949760b75c3b46fc86686274965fca1 (diff) |
V4L/DVB: Fix a merge conflict that affects unlock_ioctl
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index a7702e3d149c..0ca7978654b5 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
@@ -236,20 +236,20 @@ static unsigned int v4l2_poll(struct file *filp, struct poll_table_struct *poll) | |||
236 | static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 236 | static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
237 | { | 237 | { |
238 | struct video_device *vdev = video_devdata(filp); | 238 | struct video_device *vdev = video_devdata(filp); |
239 | int ret; | 239 | int ret = -ENODEV; |
240 | 240 | ||
241 | if (!vdev->fops->ioctl) | ||
242 | return -ENOTTY; | ||
243 | if (vdev->fops->unlocked_ioctl) { | 241 | if (vdev->fops->unlocked_ioctl) { |
244 | if (vdev->lock) | 242 | if (vdev->lock) |
245 | mutex_lock(vdev->lock); | 243 | mutex_lock(vdev->lock); |
246 | ret = vdev->fops->unlocked_ioctl(filp, cmd, arg); | 244 | if (video_is_registered(vdev)) |
245 | ret = vdev->fops->unlocked_ioctl(filp, cmd, arg); | ||
247 | if (vdev->lock) | 246 | if (vdev->lock) |
248 | mutex_unlock(vdev->lock); | 247 | mutex_unlock(vdev->lock); |
249 | } else if (vdev->fops->ioctl) { | 248 | } else if (vdev->fops->ioctl) { |
250 | /* TODO: convert all drivers to unlocked_ioctl */ | 249 | /* TODO: convert all drivers to unlocked_ioctl */ |
251 | lock_kernel(); | 250 | lock_kernel(); |
252 | ret = vdev->fops->ioctl(filp, cmd, arg); | 251 | if (video_is_registered(vdev)) |
252 | ret = vdev->fops->ioctl(filp, cmd, arg); | ||
253 | unlock_kernel(); | 253 | unlock_kernel(); |
254 | } else | 254 | } else |
255 | ret = -ENOTTY; | 255 | ret = -ENOTTY; |