diff options
author | Bob Liu <lliubbo@gmail.com> | 2011-05-06 04:20:09 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 11:14:40 -0400 |
commit | ecc6517d947e91f02eb5a3a055f524122846f84e (patch) | |
tree | fdeccb017f68c070bdf4c699cf6ff48d742512c1 /drivers/media/video/v4l2-dev.c | |
parent | 4bc90dea7be181cd876500b1d766faaa77c3d493 (diff) |
[media] Revert "V4L/DVB: v4l2-dev: remove get_unmapped_area"
This reverts commit c29fcff3daafbf46d64a543c1950bbd206ad8c1c.
Signed-off-by: Bob Liu <lliubbo@gmail.com>
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 | 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 |