Merge tag 'drm-intel-next-2016-10-24' of git://anongit.freedesktop.org/drm-intel...
[sfrench/cifs-2.6.git] / Documentation / media / uapi / v4l / func-munmap.rst
1 .. -*- coding: utf-8; mode: rst -*-
2
3 .. _func-munmap:
4
5 *************
6 V4L2 munmap()
7 *************
8
9 Name
10 ====
11
12 v4l2-munmap - Unmap device memory
13
14
15 Synopsis
16 ========
17
18 .. code-block:: c
19
20     #include <unistd.h>
21     #include <sys/mman.h>
22
23
24 .. c:function:: int munmap( void *start, size_t length )
25     :name: v4l2-munmap
26
27 Arguments
28 =========
29
30 ``start``
31     Address of the mapped buffer as returned by the
32     :ref:`mmap() <func-mmap>` function.
33
34 ``length``
35     Length of the mapped buffer. This must be the same value as given to
36     :ref:`mmap() <func-mmap>` and returned by the driver in the struct
37     :c:type:`v4l2_buffer` ``length`` field for the
38     single-planar API and in the struct
39     :c:type:`v4l2_plane` ``length`` field for the
40     multi-planar API.
41
42
43 Description
44 ===========
45
46 Unmaps a previously with the :ref:`mmap() <func-mmap>` function mapped
47 buffer and frees it, if possible.
48
49
50 Return Value
51 ============
52
53 On success :ref:`munmap() <func-munmap>` returns 0, on failure -1 and the
54 ``errno`` variable is set appropriately:
55
56 EINVAL
57     The ``start`` or ``length`` is incorrect, or no buffers have been
58     mapped yet.