diff options
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r-- | drivers/media/video/v4l2-dev.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 6dc7196296b3..19d5ae293780 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c | |||
@@ -352,6 +352,23 @@ static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
352 | return ret; | 352 | return ret; |
353 | } | 353 | } |
354 | 354 | ||
355 | #ifdef CONFIG_MMU | ||
356 | #define v4l2_get_unmapped_area NULL | ||
357 | #else | ||
358 | static unsigned long v4l2_get_unmapped_area(struct file *filp, | ||
359 | unsigned long addr, unsigned long len, unsigned long pgoff, | ||
360 | unsigned long flags) | ||
361 | { | ||
362 | struct video_device *vdev = video_devdata(filp); | ||
363 | |||
364 | if (!vdev->fops->get_unmapped_area) | ||
365 | return -ENOSYS; | ||
366 | if (!video_is_registered(vdev)) | ||
367 | return -ENODEV; | ||
368 | return vdev->fops->get_unmapped_area(filp, addr, len, pgoff, flags); | ||
369 | } | ||
370 | #endif | ||
371 | |||
355 | static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm) | 372 | static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm) |
356 | { | 373 | { |
357 | struct video_device *vdev = video_devdata(filp); | 374 | struct video_device *vdev = video_devdata(filp); |
@@ -454,6 +471,7 @@ static const struct file_operations v4l2_fops = { | |||
454 | .read = v4l2_read, | 471 | .read = v4l2_read, |
455 | .write = v4l2_write, | 472 | .write = v4l2_write, |
456 | .open = v4l2_open, | 473 | .open = v4l2_open, |
474 | .get_unmapped_area = v4l2_get_unmapped_area, | ||
457 | .mmap = v4l2_mmap, | 475 | .mmap = v4l2_mmap, |
458 | .unlocked_ioctl = v4l2_ioctl, | 476 | .unlocked_ioctl = v4l2_ioctl, |
459 | #ifdef CONFIG_COMPAT | 477 | #ifdef CONFIG_COMPAT |