hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/media/v4l2-core/videobuf-vmalloc.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * helper functions for vmalloc video4linux capture buffers
34 *
....@@ -6,11 +7,7 @@
67 * into PAGE_SIZE chunks). They also assume the driver does not need
78 * to touch the video data.
89 *
9
- * (c) 2007 Mauro Carvalho Chehab, <mchehab@kernel.org>
10
- *
11
- * This program is free software; you can redistribute it and/or modify
12
- * it under the terms of the GNU General Public License as published by
13
- * the Free Software Foundation; either version 2
10
+ * (c) 2007 Mauro Carvalho Chehab <mchehab@kernel.org>
1411 */
1512
1613 #include <linux/init.h>
....@@ -18,12 +15,12 @@
1815 #include <linux/moduleparam.h>
1916 #include <linux/slab.h>
2017 #include <linux/interrupt.h>
18
+#include <linux/pgtable.h>
2119
2220 #include <linux/pci.h>
2321 #include <linux/vmalloc.h>
2422 #include <linux/pagemap.h>
2523 #include <asm/page.h>
26
-#include <asm/pgtable.h>
2724
2825 #include <media/videobuf-vmalloc.h>
2926
....@@ -171,7 +168,7 @@
171168
172169 /* All handling should be done by __videobuf_mmap_mapper() */
173170 if (!mem->vaddr) {
174
- printk(KERN_ERR "memory is not alloced/mmapped.\n");
171
+ printk(KERN_ERR "memory is not allocated/mmapped.\n");
175172 return -EINVAL;
176173 }
177174 break;
....@@ -196,26 +193,6 @@
196193 }
197194 dprintk(1, "vmalloc is at addr %p (%d pages)\n",
198195 mem->vaddr, pages);
199
-
200
-#if 0
201
- int rc;
202
- /* Kernel userptr is used also by read() method. In this case,
203
- there's no need to remap, since data will be copied to user
204
- */
205
- if (!vb->baddr)
206
- return 0;
207
-
208
- /* FIXME: to properly support USERPTR, remap should occur.
209
- The code below won't work, since mem->vma = NULL
210
- */
211
- /* Try to remap memory */
212
- rc = remap_vmalloc_range(mem->vma, (void *)vb->baddr, 0);
213
- if (rc < 0) {
214
- printk(KERN_ERR "mmap: remap failed with error %d", rc);
215
- return -ENOMEM;
216
- }
217
-#endif
218
-
219196 break;
220197 case V4L2_MEMORY_OVERLAY:
221198 default: