0157-ASoC-bcm-add-missing-.owner-fields-in-sound-card-dri.patch 4.0 KB

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