]> Git Repo - linux.git/commit
ALSA: pcm: Handle special page mapping in the default mmap handler
authorTakashi Iwai <[email protected]>
Tue, 5 Nov 2019 08:01:37 +0000 (09:01 +0100)
committerTakashi Iwai <[email protected]>
Wed, 6 Nov 2019 14:43:33 +0000 (15:43 +0100)
commit7e8edae39fd1f880f098612c991cf6d0f646c20d
treefce448380f7e5f00ee63a87614612e6bbc8b9899
parent1fe7f397cfe229494a88c6496b53ba532d4d4a42
ALSA: pcm: Handle special page mapping in the default mmap handler

When a driver needs to deal with a special buffer like a SG or a
vmalloc buffer, it has to set up the PCM page ops explicitly for the
corresponding helper function.  This is rather error-prone and many
people forgot or incorrectly used it.

For simplifying the call patterns and avoiding such a potential bug,
this patch enhances the PCM default mmap handler to check the
(pre-)allocated buffer type and handles the page gracefully depending
on the buffer type.  If the PCM page ops is given, the ops is still
used in a higher priority.  The new code path is only for the default
(NULL page ops) case.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
sound/core/pcm_native.c
This page took 0.041352 seconds and 4 git commands to generate.