lightnvm: NVM should depend on HAS_DMA
[deliverable/linux.git] / Documentation / media / uapi / v4l / func-munmap.rst
CommitLineData
5377d91f
MH
1.. -*- coding: utf-8; mode: rst -*-
2
3.. _func-munmap:
4
5*************
6V4L2 munmap()
7*************
8
15e7d615 9Name
586027ce 10====
5377d91f 11
586027ce 12v4l2-munmap - Unmap device memory
5377d91f 13
15e7d615
MCC
14
15Synopsis
5377d91f
MH
16========
17
18.. code-block:: c
19
20 #include <unistd.h>
21 #include <sys/mman.h>
22
23
b7e67f6c 24.. cpp:function:: int munmap( void *start, size_t length )
5377d91f 25
586027ce 26
15e7d615 27Arguments
5377d91f
MH
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
760c7010 36 :ref:`mmap() <func-mmap>` and returned by the driver in the struct
5377d91f
MH
37 :ref:`v4l2_buffer <v4l2-buffer>` ``length`` field for the
38 single-planar API and in the struct
39 :ref:`v4l2_plane <v4l2-plane>` ``length`` field for the
40 multi-planar API.
41
42
15e7d615 43Description
5377d91f
MH
44===========
45
46Unmaps a previously with the :ref:`mmap() <func-mmap>` function mapped
47buffer and frees it, if possible.
48
49
15e7d615 50Return Value
5377d91f
MH
51============
52
760c7010 53On success :ref:`munmap() <func-munmap>` returns 0, on failure -1 and the
5377d91f
MH
54``errno`` variable is set appropriately:
55
56EINVAL
57 The ``start`` or ``length`` is incorrect, or no buffers have been
58 mapped yet.
This page took 0.046824 seconds and 5 git commands to generate.