brcm2708: update linux 4.4 patches to latest version
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.4 / 0157-ASoC-bcm-add-missing-.owner-fields-in-sound-card-dri.patch
1 From 8369af719005849271d4c50a87dc6422b83dc276 Mon Sep 17 00:00:00 2001
2 From: Matthias Reichl <hias@horus.com>
3 Date: Tue, 23 Feb 2016 17:28:23 +0100
4 Subject: [PATCH] ASoC: bcm: add missing .owner fields in sound card drivers
5
6 If snd_soc_card.owner is not set the kernel won't do usage refcounting
7 and one can remove the card driver module while it's in use (eg playback
8 active) - which leads to a kernel crash.
9
10 The missing owner field also prevents ALSA slot ordering
11 (options snd slots=module-name1,module-name-2,...) from working with
12 the I2S cards as it has no module name to match against.
13
14 Fix these issues by setting the .owner field in the snd_soc_card structs.
15
16 Signed-off-by: Matthias Reichl <hias@horus.com>
17 ---
18 sound/soc/bcm/hifiberry_amp.c | 1 +
19 sound/soc/bcm/hifiberry_dac.c | 1 +
20 sound/soc/bcm/hifiberry_dacplus.c | 1 +
21 sound/soc/bcm/hifiberry_digi.c | 1 +
22 sound/soc/bcm/iqaudio-dac.c | 1 +
23 sound/soc/bcm/raspidac3.c | 1 +
24 sound/soc/bcm/rpi-dac.c | 1 +
25 sound/soc/bcm/rpi-proto.c | 1 +
26 8 files changed, 8 insertions(+)
27
28 --- a/sound/soc/bcm/hifiberry_amp.c
29 +++ b/sound/soc/bcm/hifiberry_amp.c
30 @@ -61,6 +61,7 @@ static struct snd_soc_dai_link snd_rpi_h
31
32 static struct snd_soc_card snd_rpi_hifiberry_amp = {
33 .name = "snd_rpi_hifiberry_amp",
34 + .owner = THIS_MODULE,
35 .dai_link = snd_rpi_hifiberry_amp_dai,
36 .num_links = ARRAY_SIZE(snd_rpi_hifiberry_amp_dai),
37 };
38 --- a/sound/soc/bcm/hifiberry_dac.c
39 +++ b/sound/soc/bcm/hifiberry_dac.c
40 @@ -63,6 +63,7 @@ static struct snd_soc_dai_link snd_rpi_h
41 /* audio machine driver */
42 static struct snd_soc_card snd_rpi_hifiberry_dac = {
43 .name = "snd_rpi_hifiberry_dac",
44 + .owner = THIS_MODULE,
45 .dai_link = snd_rpi_hifiberry_dac_dai,
46 .num_links = ARRAY_SIZE(snd_rpi_hifiberry_dac_dai),
47 };
48 --- a/sound/soc/bcm/hifiberry_dacplus.c
49 +++ b/sound/soc/bcm/hifiberry_dacplus.c
50 @@ -287,6 +287,7 @@ static struct snd_soc_dai_link snd_rpi_h
51 /* audio machine driver */
52 static struct snd_soc_card snd_rpi_hifiberry_dacplus = {
53 .name = "snd_rpi_hifiberry_dacplus",
54 + .owner = THIS_MODULE,
55 .dai_link = snd_rpi_hifiberry_dacplus_dai,
56 .num_links = ARRAY_SIZE(snd_rpi_hifiberry_dacplus_dai),
57 };
58 --- a/sound/soc/bcm/hifiberry_digi.c
59 +++ b/sound/soc/bcm/hifiberry_digi.c
60 @@ -164,6 +164,7 @@ static struct snd_soc_dai_link snd_rpi_h
61 /* audio machine driver */
62 static struct snd_soc_card snd_rpi_hifiberry_digi = {
63 .name = "snd_rpi_hifiberry_digi",
64 + .owner = THIS_MODULE,
65 .dai_link = snd_rpi_hifiberry_digi_dai,
66 .num_links = ARRAY_SIZE(snd_rpi_hifiberry_digi_dai),
67 };
68 --- a/sound/soc/bcm/iqaudio-dac.c
69 +++ b/sound/soc/bcm/iqaudio-dac.c
70 @@ -77,6 +77,7 @@ static struct snd_soc_dai_link snd_rpi_i
71 /* audio machine driver */
72 static struct snd_soc_card snd_rpi_iqaudio_dac = {
73 .name = "IQaudIODAC",
74 + .owner = THIS_MODULE,
75 .dai_link = snd_rpi_iqaudio_dac_dai,
76 .num_links = ARRAY_SIZE(snd_rpi_iqaudio_dac_dai),
77 };
78 --- a/sound/soc/bcm/raspidac3.c
79 +++ b/sound/soc/bcm/raspidac3.c
80 @@ -128,6 +128,7 @@ static struct snd_soc_dai_link snd_rpi_r
81 /* audio machine driver */
82 static struct snd_soc_card snd_rpi_raspidac3 = {
83 .name = "RaspiDAC Rev.3x HiFi Audio Card",
84 + .owner = THIS_MODULE,
85 .dai_link = snd_rpi_raspidac3_dai,
86 .num_links = ARRAY_SIZE(snd_rpi_raspidac3_dai),
87 };
88 --- a/sound/soc/bcm/rpi-dac.c
89 +++ b/sound/soc/bcm/rpi-dac.c
90 @@ -60,6 +60,7 @@ static struct snd_soc_dai_link snd_rpi_r
91 /* audio machine driver */
92 static struct snd_soc_card snd_rpi_rpi_dac = {
93 .name = "snd_rpi_rpi_dac",
94 + .owner = THIS_MODULE,
95 .dai_link = snd_rpi_rpi_dac_dai,
96 .num_links = ARRAY_SIZE(snd_rpi_rpi_dac_dai),
97 };
98 --- a/sound/soc/bcm/rpi-proto.c
99 +++ b/sound/soc/bcm/rpi-proto.c
100 @@ -91,6 +91,7 @@ static struct snd_soc_dai_link snd_rpi_p
101 /* audio machine driver */
102 static struct snd_soc_card snd_rpi_proto = {
103 .name = "snd_rpi_proto",
104 + .owner = THIS_MODULE,
105 .dai_link = snd_rpi_proto_dai,
106 .num_links = ARRAY_SIZE(snd_rpi_proto_dai),
107 };