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/nuc900-ac97.c') diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index 9c0edad90d8..7544d249807 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 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 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'sound/soc/nuc900/nuc900-ac97.c') diff --git a/sound/soc/nuc900/nuc900-ac97.c b/sound/soc/nuc900/nuc900-ac97.c index 7544d249807..f0c790451bd 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!"); -- cgit v1.2.3