d4383c4f65c463873cf6549e36201e00d00a6b13
[AGL/meta-agl-demo.git] / recipes-kernel / most / files / 0011-handle-snd_pcm_lib_mmap_vmalloc-removal.patch
1 Handle snd_pcm_lib_mmap_vmalloc removal in 4.19
2
3 Add .mmap field back to pcm_ops for kernels older than 4.19.
4
5 Upstream-Status: Inappropriate
6
7 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
8
9 diff --git a/aim-sound/sound.c b/aim-sound/sound.c
10 index 4b3329b..c0a26be 100644
11 --- a/aim-sound/sound.c
12 +++ b/aim-sound/sound.c
13 @@ -17,6 +17,7 @@
14  #include <linux/printk.h>
15  #include <linux/kernel.h>
16  #include <linux/init.h>
17 +#include <linux/version.h>
18  #include <sound/core.h>
19  #include <sound/pcm.h>
20  #include <sound/pcm_params.h>
21 @@ -463,6 +464,9 @@ static const struct snd_pcm_ops pcm_ops = {
22         .trigger    = pcm_trigger,
23         .pointer    = pcm_pointer,
24         .page       = snd_pcm_lib_get_vmalloc_page,
25 +#if LINUX_VERSION_CODE <  KERNEL_VERSION(4,19,0)
26 +       .mmap       = snd_pcm_lib_mmap_vmalloc,
27 +#endif
28  };
29  
30  static int split_arg_list(char *buf, char **card_name, u16 *ch_num,