aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Liu <lliubbo@gmail.com>2011-05-06 04:20:09 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-05-20 11:14:40 -0400
commitecc6517d947e91f02eb5a3a055f524122846f84e (patch)
treefdeccb017f68c070bdf4c699cf6ff48d742512c1
parent4bc90dea7be181cd876500b1d766faaa77c3d493 (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>
-rw-r--r--drivers/media/video/v4l2-dev.c18
-rw-r--r--include/media/v4l2-dev.h2
2 files changed, 20 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
358static 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
355static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm) 372static 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
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 8266d5ade2ff..93e96fb93452 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -62,6 +62,8 @@ struct v4l2_file_operations {
62 unsigned int (*poll) (struct file *, struct poll_table_struct *); 62 unsigned int (*poll) (struct file *, struct poll_table_struct *);
63 long (*ioctl) (struct file *, unsigned int, unsigned long); 63 long (*ioctl) (struct file *, unsigned int, unsigned long);
64 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); 64 long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
65 unsigned long (*get_unmapped_area) (struct file *, unsigned long,
66 unsigned long, unsigned long, unsigned long);
65 int (*mmap) (struct file *, struct vm_area_struct *); 67 int (*mmap) (struct file *, struct vm_area_struct *);
66 int (*open) (struct file *); 68 int (*open) (struct file *);
67 int (*release) (struct file *); 69 int (*release) (struct file *);