Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/imx/imx-pcm-dma-mx2.c | 12 +----------- sound/soc/imx/imx-pcm-fiq.c | 12 +----------- sound/soc/imx/imx-ssi.c | 13 +------------ 3 files changed, 3 insertions(+), 34 deletions(-)
diff --git a/sound/soc/imx/imx-pcm-dma-mx2.c b/sound/soc/imx/imx-pcm-dma-mx2.c index 7d28de9..aecdba9 100644 --- a/sound/soc/imx/imx-pcm-dma-mx2.c +++ b/sound/soc/imx/imx-pcm-dma-mx2.c @@ -326,16 +326,6 @@ static struct platform_driver imx_pcm_driver = { .remove = __devexit_p(imx_soc_platform_remove), };
-static int __init snd_imx_pcm_init(void) -{ - return platform_driver_register(&imx_pcm_driver); -} -module_init(snd_imx_pcm_init); - -static void __exit snd_imx_pcm_exit(void) -{ - platform_driver_unregister(&imx_pcm_driver); -} -module_exit(snd_imx_pcm_exit); +module_platform_driver(imx_pcm_driver); MODULE_LICENSE("GPL"); MODULE_ALIAS("platform:imx-pcm-audio"); diff --git a/sound/soc/imx/imx-pcm-fiq.c b/sound/soc/imx/imx-pcm-fiq.c index 8df0fae2..d7ea0b3 100644 --- a/sound/soc/imx/imx-pcm-fiq.c +++ b/sound/soc/imx/imx-pcm-fiq.c @@ -331,14 +331,4 @@ static struct platform_driver imx_pcm_driver = { .remove = __devexit_p(imx_soc_platform_remove), };
-static int __init snd_imx_pcm_init(void) -{ - return platform_driver_register(&imx_pcm_driver); -} -module_init(snd_imx_pcm_init); - -static void __exit snd_imx_pcm_exit(void) -{ - platform_driver_unregister(&imx_pcm_driver); -} -module_exit(snd_imx_pcm_exit); +module_platform_driver(imx_pcm_driver); diff --git a/sound/soc/imx/imx-ssi.c b/sound/soc/imx/imx-ssi.c index 4c05e2b..d4b6367 100644 --- a/sound/soc/imx/imx-ssi.c +++ b/sound/soc/imx/imx-ssi.c @@ -757,18 +757,7 @@ static struct platform_driver imx_ssi_driver = { }, };
-static int __init imx_ssi_init(void) -{ - return platform_driver_register(&imx_ssi_driver); -} - -static void __exit imx_ssi_exit(void) -{ - platform_driver_unregister(&imx_ssi_driver); -} - -module_init(imx_ssi_init); -module_exit(imx_ssi_exit); +module_platform_driver(imx_ssi_driver);
/* Module information */ MODULE_AUTHOR("Sascha Hauer, s.hauer@pengutronix.de");