Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Bob Liu and committed by
Mauro Carvalho Chehab
ecc6517d 4bc90dea

+20
+18
drivers/media/video/v4l2-dev.c
··· 352 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 372 static int v4l2_mmap(struct file *filp, struct vm_area_struct *vm) 356 373 { 357 374 struct video_device *vdev = video_devdata(filp); ··· 471 454 .read = v4l2_read, 472 455 .write = v4l2_write, 473 456 .open = v4l2_open, 457 + .get_unmapped_area = v4l2_get_unmapped_area, 474 458 .mmap = v4l2_mmap, 475 459 .unlocked_ioctl = v4l2_ioctl, 476 460 #ifdef CONFIG_COMPAT
+2
include/media/v4l2-dev.h
··· 62 62 unsigned int (*poll) (struct file *, struct poll_table_struct *); 63 63 long (*ioctl) (struct file *, unsigned int, unsigned long); 64 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 67 int (*mmap) (struct file *, struct vm_area_struct *); 66 68 int (*open) (struct file *); 67 69 int (*release) (struct file *);