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

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