From 85e7652d89293a6dab42bfd31f276f8bc072d4c5 Mon Sep 17 00:00:00 2001 From: Lars-Peter Clausen Date: Wed, 23 Nov 2011 11:40:40 +0100 Subject: ASoC: Constify snd_soc_dai_ops structs Commit 1ee46ebd("ASoC: Make the DAI ops constant in the DAI structure") introduced the possibility to have constant DAI ops structures, yet this is barley used in both existing drivers and also new drivers being submitted, although none of them modifies its DAI ops structure. The later is not surprising since existing drivers are often used as templates for new drivers. So this patch just constifies all existing snd_soc_dai_ops structs to eliminate the issue altogether. The patch was generated with the following coccinelle semantic patch: // @@ identifier ops; @@ -struct snd_soc_dai_ops ops = +const struct snd_soc_dai_ops ops = { ... }; // Signed-off-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/nuc900/nuc900-ac97.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/soc/nuc900') diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index 9c0edad90d8b..7544d249807e 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c @@ -291,7 +291,7 @@ static int nuc900_ac97_remove(struct snd_soc_dai *dai) return 0; } -static struct snd_soc_dai_ops nuc900_ac97_dai_ops = { +static const struct snd_soc_dai_ops nuc900_ac97_dai_ops = { .trigger = nuc900_ac97_trigger, }; -- cgit v1.2.3-59-g8ed1b From d0efa6a279e53df0f695382a5a6958e8a9863bff Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Thu, 24 Nov 2011 10:45:32 +0800 Subject: ASoC: Convert nuc900 directory to module_platform_driver Factor out some boilerplate code. Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- sound/soc/nuc900/nuc900-ac97.c | 13 +------------ sound/soc/nuc900/nuc900-pcm.c | 12 +----------- 2 files changed, 2 insertions(+), 23 deletions(-) (limited to 'sound/soc/nuc900') diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index 7544d249807e..f0c790451bd6 100644 --- a/sound/soc/nuc900/nuc900-ac97.c +++ b/sound/soc/nuc900/nuc900-ac97.c @@ -405,18 +405,7 @@ static struct platform_driver nuc900_ac97_driver = { .remove = __devexit_p(nuc900_ac97_drvremove), }; -static int __init nuc900_ac97_init(void) -{ - return platform_driver_register(&nuc900_ac97_driver); -} - -static void __exit nuc900_ac97_exit(void) -{ - platform_driver_unregister(&nuc900_ac97_driver); -} - -module_init(nuc900_ac97_init); -module_exit(nuc900_ac97_exit); +module_platform_driver(nuc900_ac97_driver); MODULE_AUTHOR("Wan ZongShun "); MODULE_DESCRIPTION("NUC900 AC97 SoC driver!"); diff --git a/sound/soc/nuc900/nuc900-pcm.c b/sound/soc/nuc900/nuc900-pcm.c index ae8d6806966b..37585b47f4e3 100644 --- a/sound/soc/nuc900/nuc900-pcm.c +++ b/sound/soc/nuc900/nuc900-pcm.c @@ -358,17 +358,7 @@ static struct platform_driver nuc900_pcm_driver = { .remove = __devexit_p(nuc900_soc_platform_remove), }; -static int __init nuc900_pcm_init(void) -{ - return platform_driver_register(&nuc900_pcm_driver); -} -module_init(nuc900_pcm_init); - -static void __exit nuc900_pcm_exit(void) -{ - platform_driver_unregister(&nuc900_pcm_driver); -} -module_exit(nuc900_pcm_exit); +module_platform_driver(nuc900_pcm_driver); MODULE_AUTHOR("Wan ZongShun, "); MODULE_DESCRIPTION("nuc900 Audio DMA module"); -- cgit v1.2.3-59-g8ed1b From b5a67048d012cc69618140ce31316eedc9c57e8c Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Fri, 23 Dec 2011 14:51:17 +0800 Subject: ASoC: nuc900: Add .owner to struct snd_soc_card MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add missing .owner of struct snd_soc_card. This prevents the module from being removed from underneath its users. Reported-by: Lothar Waßmann Signed-off-by: Axel Lin Signed-off-by: Mark Brown --- sound/soc/nuc900/nuc900-audio.c | 1 + 1 file changed, 1 insertion(+) (limited to 'sound/soc/nuc900') diff --git a/sound/soc/nuc900/nuc900-audio.c b/sound/soc/nuc900/nuc900-audio.c index 38a2d0d883b5..2f6e6fd6e05c 100644 --- a/sound/soc/nuc900/nuc900-audio.c +++ b/sound/soc/nuc900/nuc900-audio.c @@ -32,6 +32,7 @@ static struct snd_soc_dai_link nuc900evb_ac97_dai = { static struct snd_soc_card nuc900evb_audio_machine = { .name = "NUC900EVB_AC97", + .owner = THIS_MODULE, .dai_link = &nuc900evb_ac97_dai, .num_links = 1, }; -- cgit v1.2.3-59-g8ed1b