[media] Revert "V4L/DVB: v4l2-dev: remove get_unmapped_area"
authorBob Liu <lliubbo@gmail.com>
Fri, 6 May 2011 08:20:09 +0000 (05:20 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 20 May 2011 15:14:40 +0000 (12:14 -0300)
This reverts commit c29fcff3daafbf46d64a543c1950bbd206ad8c1c.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/v4l2-dev.c
include/media/v4l2-dev.h

index 6dc7196296b341bdf87956a600ae74ebb522835e..19d5ae2937802a41e8784bf691400162c57c9152 100644 (file)
@@ -352,6 +352,23 @@ static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
        return ret;
 }
 
+#ifdef CONFIG_MMU
+#define v4l2_get_unmapped_area NULL
+#else
+static unsigned long v4l2_get_unmapped_area(struct file *filp,
+               unsigned long addr, unsigned long len, unsigned long pgoff,
+               unsigned long flags)
+{
+       struct video_device *vdev = video_devdata(filp);
+
+       if (!vdev->fops->get_unmapped_area)
+               return -ENOSYS;
+       if (!video_is_registered(vdev))
+               return -ENODEV;
+       return vdev->fops->get_unmapped_area(filp, addr, len, pgoff, flags);
+}
+#endif
+
 static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm)
 {
        struct video_device *vdev = video_devdata(filp);
@@ -454,6 +471,7 @@ static const struct file_operations v4l2_fops = {
        .read = v4l2_read,
        .write = v4l2_write,
        .open = v4l2_open,
+       .get_unmapped_area = v4l2_get_unmapped_area,
        .mmap = v4l2_mmap,
        .unlocked_ioctl = v4l2_ioctl,
 #ifdef CONFIG_COMPAT
index 8266d5ade2ffd39532cc4e3347e549524334c273..93e96fb934526e44b327e8d677bb91f7accd80c4 100644 (file)
@@ -62,6 +62,8 @@ struct v4l2_file_operations {
        unsigned int (*poll) (struct file *, struct poll_table_struct *);
        long (*ioctl) (struct file *, unsigned int, unsigned long);
        long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long);
+       unsigned long (*get_unmapped_area) (struct file *, unsigned long,
+                               unsigned long, unsigned long, unsigned long);
        int (*mmap) (struct file *, struct vm_area_struct *);
        int (*open) (struct file *);
        int (*release) (struct file *);
This page took 0.077718 seconds and 5 git commands to generate.