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