ASoC: fsl: Add .owner to struct snd_soc_card
authorAxel Lin <axel.lin@gmail.com>
Thu, 22 Dec 2011 13:04:54 +0000 (21:04 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 22 Dec 2011 17:34:32 +0000 (17:34 +0000)
Missed .owner of struct snd_soc_card will prevent the module from being
removed from underneath its users.

Reported-by: Lothar Waßmann <LW@KARO-electronics.de>
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/fsl/efika-audio-fabric.c
sound/soc/fsl/pcm030-audio-fabric.c

index 108b5d8bd0e944bc2f0525c930c35df643e1a500..b2acd3293ea886217290ede96d0c3350cc07f7fe 100644 (file)
@@ -31,8 +31,6 @@
 
 #define DRV_NAME "efika-audio-fabric"
 
-static struct snd_soc_card card;
-
 static struct snd_soc_dai_link efika_fabric_dai[] = {
 {
        .name = "AC97",
@@ -52,6 +50,13 @@ static struct snd_soc_dai_link efika_fabric_dai[] = {
 },
 };
 
+static struct snd_soc_card card = {
+       .name = "Efika",
+       .owner = THIS_MODULE,
+       .dai_link = efika_fabric_dai,
+       .num_links = ARRAY_SIZE(efika_fabric_dai),
+};
+
 static __init int efika_fabric_init(void)
 {
        struct platform_device *pdev;
@@ -60,11 +65,6 @@ static __init int efika_fabric_init(void)
        if (!of_machine_is_compatible("bplan,efika"))
                return -ENODEV;
 
-       card.name = "Efika";
-       card.dai_link = efika_fabric_dai;
-       card.num_links = ARRAY_SIZE(efika_fabric_dai);
-
-
        pdev = platform_device_alloc("soc-audio", 1);
        if (!pdev) {
                pr_err("efika_fabric_init: platform_device_alloc() failed\n");
index ba4d85e317ed459907601b1df426738ddf88ee68..b3af55dcde9de54bbe2547e0ef16dcc2ce9288df 100644 (file)
@@ -31,8 +31,6 @@
 
 #define DRV_NAME "pcm030-audio-fabric"
 
-static struct snd_soc_card card;
-
 static struct snd_soc_dai_link pcm030_fabric_dai[] = {
 {
        .name = "AC97",
@@ -52,6 +50,13 @@ static struct snd_soc_dai_link pcm030_fabric_dai[] = {
 },
 };
 
+static struct snd_soc_card card = {
+       .name = "pcm030",
+       .owner = THIS_MODULE,
+       .dai_link = pcm030_fabric_dai,
+       .num_links = ARRAY_SIZE(pcm030_fabric_dai),
+};
+
 static __init int pcm030_fabric_init(void)
 {
        struct platform_device *pdev;
@@ -60,11 +65,6 @@ static __init int pcm030_fabric_init(void)
        if (!of_machine_is_compatible("phytec,pcm030"))
                return -ENODEV;
 
-
-       card.name = "pcm030";
-       card.dai_link = pcm030_fabric_dai;
-       card.num_links = ARRAY_SIZE(pcm030_fabric_dai);
-
        pdev = platform_device_alloc("soc-audio", 1);
        if (!pdev) {
                pr_err("pcm030_fabric_init: platform_device_alloc() failed\n");