ASoC: Convert atmel directory to module_platform_driver
authorAxel Lin <axel.lin@gmail.com>
Fri, 25 Nov 2011 02:05:45 +0000 (10:05 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 25 Nov 2011 13:15:01 +0000 (13:15 +0000)
Factor out some boilerplate code.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/atmel/atmel-pcm.c
sound/soc/atmel/atmel_ssc_dai.c

index f81d4c3f8956efa24d4becf3952b6242554a0866..60de05525c06f0d6d676ae2d062acfa890762655 100644 (file)
@@ -495,17 +495,7 @@ static struct platform_driver atmel_pcm_driver = {
        .remove = __devexit_p(atmel_soc_platform_remove),
 };
 
-static int __init snd_atmel_pcm_init(void)
-{
-       return platform_driver_register(&atmel_pcm_driver);
-}
-module_init(snd_atmel_pcm_init);
-
-static void __exit snd_atmel_pcm_exit(void)
-{
-       platform_driver_unregister(&atmel_pcm_driver);
-}
-module_exit(snd_atmel_pcm_exit);
+module_platform_driver(atmel_pcm_driver);
 
 MODULE_AUTHOR("Sedji Gaouaou <sedji.gaouaou@atmel.com>");
 MODULE_DESCRIPTION("Atmel PCM module");
index a67fc9b7dbe7162707a03b1f3bbbc02f7cc6f473..354341ec0f42f1129adbaaf310366af46b866229 100644 (file)
@@ -859,17 +859,7 @@ int atmel_ssc_set_audio(int ssc_id)
 }
 EXPORT_SYMBOL_GPL(atmel_ssc_set_audio);
 
-static int __init snd_atmel_ssc_init(void)
-{
-       return platform_driver_register(&asoc_ssc_driver);
-}
-module_init(snd_atmel_ssc_init);
-
-static void __exit snd_atmel_ssc_exit(void)
-{
-       platform_driver_unregister(&asoc_ssc_driver);
-}
-module_exit(snd_atmel_ssc_exit);
+module_platform_driver(asoc_ssc_driver);
 
 /* Module information */
 MODULE_AUTHOR("Sedji Gaouaou, sedji.gaouaou@atmel.com, www.atmel.com");