[alsa-devel] [PATCH 1/8] ASoC: Convert atmel directory to module_platform_driver
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/atmel/atmel-pcm.c | 12 +----------- sound/soc/atmel/atmel_ssc_dai.c | 12 +----------- 2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c index f81d4c3..60de055 100644 --- a/sound/soc/atmel/atmel-pcm.c +++ b/sound/soc/atmel/atmel-pcm.c @@ -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"); diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index a67fc9b..354341e 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -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");
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/au1x/db1000.c | 13 +------------ sound/soc/au1x/db1200.c | 13 +------------ sound/soc/au1x/dbdma2.c | 13 +------------ sound/soc/au1x/dma.c | 13 +------------ sound/soc/au1x/i2sc.c | 13 +------------ sound/soc/au1x/psc-i2s.c | 13 +------------ 6 files changed, 6 insertions(+), 72 deletions(-)
diff --git a/sound/soc/au1x/db1000.c b/sound/soc/au1x/db1000.c index 127477a..094a207 100644 --- a/sound/soc/au1x/db1000.c +++ b/sound/soc/au1x/db1000.c @@ -57,18 +57,7 @@ static struct platform_driver db1000_audio_driver = { .remove = __devexit_p(db1000_audio_remove), };
-static int __init db1000_audio_load(void) -{ - return platform_driver_register(&db1000_audio_driver); -} - -static void __exit db1000_audio_unload(void) -{ - platform_driver_unregister(&db1000_audio_driver); -} - -module_init(db1000_audio_load); -module_exit(db1000_audio_unload); +module_platform_driver(db1000_audio_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("DB1000/DB1500/DB1100 ASoC audio"); diff --git a/sound/soc/au1x/db1200.c b/sound/soc/au1x/db1200.c index 44ad118..ec725f6 100644 --- a/sound/soc/au1x/db1200.c +++ b/sound/soc/au1x/db1200.c @@ -202,18 +202,7 @@ static struct platform_driver db1200_audio_driver = { .remove = __devexit_p(db1200_audio_remove), };
-static int __init db1200_audio_load(void) -{ - return platform_driver_register(&db1200_audio_driver); -} - -static void __exit db1200_audio_unload(void) -{ - platform_driver_unregister(&db1200_audio_driver); -} - -module_init(db1200_audio_load); -module_exit(db1200_audio_unload); +module_platform_driver(db1200_audio_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("DB1200/DB1300/DB1550 ASoC audio support"); diff --git a/sound/soc/au1x/dbdma2.c b/sound/soc/au1x/dbdma2.c index d7d04e2..09699de 100644 --- a/sound/soc/au1x/dbdma2.c +++ b/sound/soc/au1x/dbdma2.c @@ -384,18 +384,7 @@ static struct platform_driver au1xpsc_pcm_driver = { .remove = __devexit_p(au1xpsc_pcm_drvremove), };
-static int __init au1xpsc_audio_dbdma_load(void) -{ - return platform_driver_register(&au1xpsc_pcm_driver); -} - -static void __exit au1xpsc_audio_dbdma_unload(void) -{ - platform_driver_unregister(&au1xpsc_pcm_driver); -} - -module_init(au1xpsc_audio_dbdma_load); -module_exit(au1xpsc_audio_dbdma_unload); +module_platform_driver(au1xpsc_pcm_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Au12x0/Au1550 PSC Audio DMA driver"); diff --git a/sound/soc/au1x/dma.c b/sound/soc/au1x/dma.c index 177f713..dc4dae4 100644 --- a/sound/soc/au1x/dma.c +++ b/sound/soc/au1x/dma.c @@ -359,18 +359,7 @@ static struct platform_driver alchemy_pcmdma_driver = { .remove = __devexit_p(alchemy_pcm_drvremove), };
-static int __init alchemy_pcmdma_load(void) -{ - return platform_driver_register(&alchemy_pcmdma_driver); -} - -static void __exit alchemy_pcmdma_unload(void) -{ - platform_driver_unregister(&alchemy_pcmdma_driver); -} - -module_init(alchemy_pcmdma_load); -module_exit(alchemy_pcmdma_unload); +module_platform_driver(alchemy_pcmdma_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Au1000/Au1500/Au1100 Audio DMA driver"); diff --git a/sound/soc/au1x/i2sc.c b/sound/soc/au1x/i2sc.c index 6bcf48f..cb53ad8 100644 --- a/sound/soc/au1x/i2sc.c +++ b/sound/soc/au1x/i2sc.c @@ -331,18 +331,7 @@ static struct platform_driver au1xi2s_driver = { .remove = __devexit_p(au1xi2s_drvremove), };
-static int __init au1xi2s_load(void) -{ - return platform_driver_register(&au1xi2s_driver); -} - -static void __exit au1xi2s_unload(void) -{ - platform_driver_unregister(&au1xi2s_driver); -} - -module_init(au1xi2s_load); -module_exit(au1xi2s_unload); +module_platform_driver(au1xi2s_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Au1000/1500/1100 I2S ASoC driver"); diff --git a/sound/soc/au1x/psc-i2s.c b/sound/soc/au1x/psc-i2s.c index f7714d5..5c1dc8a 100644 --- a/sound/soc/au1x/psc-i2s.c +++ b/sound/soc/au1x/psc-i2s.c @@ -435,18 +435,7 @@ static struct platform_driver au1xpsc_i2s_driver = { .remove = __devexit_p(au1xpsc_i2s_drvremove), };
-static int __init au1xpsc_i2s_load(void) -{ - return platform_driver_register(&au1xpsc_i2s_driver); -} - -static void __exit au1xpsc_i2s_unload(void) -{ - platform_driver_unregister(&au1xpsc_i2s_driver); -} - -module_init(au1xpsc_i2s_load); -module_exit(au1xpsc_i2s_unload); +module_platform_driver(au1xpsc_i2s_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Au12x0/Au1550 PSC I2S ALSA ASoC audio driver");
On Fri, Nov 25, 2011 at 3:06 AM, Axel Lin axel.lin@gmail.com wrote:
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com
sound/soc/au1x/db1000.c | 13 +------------ sound/soc/au1x/db1200.c | 13 +------------ sound/soc/au1x/dbdma2.c | 13 +------------ sound/soc/au1x/dma.c | 13 +------------ sound/soc/au1x/i2sc.c | 13 +------------ sound/soc/au1x/psc-i2s.c | 13 +------------ 6 files changed, 6 insertions(+), 72 deletions(-)
[snip]
I'm sort of on the fence about the point of all this, but it looks nice, so:
Acked-by: Manuel Lauss manuel.lauss@googlemail.com
Thank you! Manuel Lauss
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/davinci/davinci-i2s.c | 12 +----------- sound/soc/davinci/davinci-mcasp.c | 12 +----------- sound/soc/davinci/davinci-pcm.c | 12 +----------- sound/soc/davinci/davinci-vcif.c | 12 +----------- 4 files changed, 4 insertions(+), 44 deletions(-)
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index f3d5ae1..ec18710 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c @@ -774,17 +774,7 @@ static struct platform_driver davinci_mcbsp_driver = { }, };
-static int __init davinci_i2s_init(void) -{ - return platform_driver_register(&davinci_mcbsp_driver); -} -module_init(davinci_i2s_init); - -static void __exit davinci_i2s_exit(void) -{ - platform_driver_unregister(&davinci_mcbsp_driver); -} -module_exit(davinci_i2s_exit); +module_platform_driver(davinci_mcbsp_driver);
MODULE_AUTHOR("Vladimir Barinov"); MODULE_DESCRIPTION("TI DAVINCI I2S (McBSP) SoC Interface"); diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 03cea9d..2152ff5 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -991,17 +991,7 @@ static struct platform_driver davinci_mcasp_driver = { }, };
-static int __init davinci_mcasp_init(void) -{ - return platform_driver_register(&davinci_mcasp_driver); -} -module_init(davinci_mcasp_init); - -static void __exit davinci_mcasp_exit(void) -{ - platform_driver_unregister(&davinci_mcasp_driver); -} -module_exit(davinci_mcasp_exit); +module_platform_driver(davinci_mcasp_driver);
MODULE_AUTHOR("Steve Chen"); MODULE_DESCRIPTION("TI DAVINCI McASP SoC Interface"); diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c index d5fe08c..65bff3d 100644 --- a/sound/soc/davinci/davinci-pcm.c +++ b/sound/soc/davinci/davinci-pcm.c @@ -886,17 +886,7 @@ static struct platform_driver davinci_pcm_driver = { .remove = __devexit_p(davinci_soc_platform_remove), };
-static int __init snd_davinci_pcm_init(void) -{ - return platform_driver_register(&davinci_pcm_driver); -} -module_init(snd_davinci_pcm_init); - -static void __exit snd_davinci_pcm_exit(void) -{ - platform_driver_unregister(&davinci_pcm_driver); -} -module_exit(snd_davinci_pcm_exit); +module_platform_driver(davinci_pcm_driver);
MODULE_AUTHOR("Vladimir Barinov"); MODULE_DESCRIPTION("TI DAVINCI PCM DMA module"); diff --git a/sound/soc/davinci/davinci-vcif.c b/sound/soc/davinci/davinci-vcif.c index dae96b8..70ce10c 100644 --- a/sound/soc/davinci/davinci-vcif.c +++ b/sound/soc/davinci/davinci-vcif.c @@ -265,17 +265,7 @@ static struct platform_driver davinci_vcif_driver = { }, };
-static int __init davinci_vcif_init(void) -{ - return platform_driver_probe(&davinci_vcif_driver, davinci_vcif_probe); -} -module_init(davinci_vcif_init); - -static void __exit davinci_vcif_exit(void) -{ - platform_driver_unregister(&davinci_vcif_driver); -} -module_exit(davinci_vcif_exit); +module_platform_driver(davinci_vcif_driver);
MODULE_AUTHOR("Miguel Aguilar"); MODULE_DESCRIPTION("Texas Instruments DaVinci ASoC Voice Codec Interface");
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/fsl/fsl_dma.c | 15 +-------------- sound/soc/fsl/fsl_ssi.c | 15 +-------------- sound/soc/fsl/mpc5200_dma.c | 12 +----------- sound/soc/fsl/mpc5200_psc_ac97.c | 16 +--------------- sound/soc/fsl/mpc5200_psc_i2s.c | 16 +--------------- 5 files changed, 5 insertions(+), 69 deletions(-)
diff --git a/sound/soc/fsl/fsl_dma.c b/sound/soc/fsl/fsl_dma.c index ef15402..4f59bba 100644 --- a/sound/soc/fsl/fsl_dma.c +++ b/sound/soc/fsl/fsl_dma.c @@ -992,20 +992,7 @@ static struct platform_driver fsl_soc_dma_driver = { .remove = __devexit_p(fsl_soc_dma_remove), };
-static int __init fsl_soc_dma_init(void) -{ - pr_info("Freescale Elo DMA ASoC PCM Driver\n"); - - return platform_driver_register(&fsl_soc_dma_driver); -} - -static void __exit fsl_soc_dma_exit(void) -{ - platform_driver_unregister(&fsl_soc_dma_driver); -} - -module_init(fsl_soc_dma_init); -module_exit(fsl_soc_dma_exit); +module_platform_driver(fsl_soc_dma_driver);
MODULE_AUTHOR("Timur Tabi timur@freescale.com"); MODULE_DESCRIPTION("Freescale Elo DMA ASoC PCM Driver"); diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 17d857e..3e06696 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -793,20 +793,7 @@ static struct platform_driver fsl_ssi_driver = { .remove = fsl_ssi_remove, };
-static int __init fsl_ssi_init(void) -{ - printk(KERN_INFO "Freescale Synchronous Serial Interface (SSI) ASoC Driver\n"); - - return platform_driver_register(&fsl_ssi_driver); -} - -static void __exit fsl_ssi_exit(void) -{ - platform_driver_unregister(&fsl_ssi_driver); -} - -module_init(fsl_ssi_init); -module_exit(fsl_ssi_exit); +module_platform_driver(fsl_ssi_driver);
MODULE_AUTHOR("Timur Tabi timur@freescale.com"); MODULE_DESCRIPTION("Freescale Synchronous Serial Interface (SSI) ASoC Driver"); diff --git a/sound/soc/fsl/mpc5200_dma.c b/sound/soc/fsl/mpc5200_dma.c index 5c6c245..e7803d3 100644 --- a/sound/soc/fsl/mpc5200_dma.c +++ b/sound/soc/fsl/mpc5200_dma.c @@ -526,17 +526,7 @@ static struct platform_driver mpc5200_hpcd_of_driver = { } };
-static int __init mpc5200_hpcd_init(void) -{ - return platform_driver_register(&mpc5200_hpcd_of_driver); -} -module_init(mpc5200_hpcd_init); - -static void __exit mpc5200_hpcd_exit(void) -{ - platform_driver_unregister(&mpc5200_hpcd_of_driver); -} -module_exit(mpc5200_hpcd_exit); +module_platform_driver(mpc5200_hpcd_of_driver);
MODULE_AUTHOR("Grant Likely grant.likely@secretlab.ca"); MODULE_DESCRIPTION("Freescale MPC5200 PSC in DMA mode ASoC Driver"); diff --git a/sound/soc/fsl/mpc5200_psc_ac97.c b/sound/soc/fsl/mpc5200_psc_ac97.c index 2fb388f..ffa00a2 100644 --- a/sound/soc/fsl/mpc5200_psc_ac97.c +++ b/sound/soc/fsl/mpc5200_psc_ac97.c @@ -325,21 +325,7 @@ static struct platform_driver psc_ac97_driver = { }, };
-/* --------------------------------------------------------------------- - * Module setup and teardown; simply register the of_platform driver - * for the PSC in AC97 mode. - */ -static int __init psc_ac97_init(void) -{ - return platform_driver_register(&psc_ac97_driver); -} -module_init(psc_ac97_init); - -static void __exit psc_ac97_exit(void) -{ - platform_driver_unregister(&psc_ac97_driver); -} -module_exit(psc_ac97_exit); +module_platform_driver(psc_ac97_driver);
MODULE_AUTHOR("Jon Smirl jonsmirl@gmail.com"); MODULE_DESCRIPTION("mpc5200 AC97 module"); diff --git a/sound/soc/fsl/mpc5200_psc_i2s.c b/sound/soc/fsl/mpc5200_psc_i2s.c index e77a1f2..7b53032 100644 --- a/sound/soc/fsl/mpc5200_psc_i2s.c +++ b/sound/soc/fsl/mpc5200_psc_i2s.c @@ -222,21 +222,7 @@ static struct platform_driver psc_i2s_driver = { }, };
-/* --------------------------------------------------------------------- - * Module setup and teardown; simply register the of_platform driver - * for the PSC in I2S mode. - */ -static int __init psc_i2s_init(void) -{ - return platform_driver_register(&psc_i2s_driver); -} -module_init(psc_i2s_init); - -static void __exit psc_i2s_exit(void) -{ - platform_driver_unregister(&psc_i2s_driver); -} -module_exit(psc_i2s_exit); +module_platform_driver(psc_i2s_driver);
MODULE_AUTHOR("Grant Likely grant.likely@secretlab.ca"); MODULE_DESCRIPTION("Freescale MPC5200 PSC in I2S mode ASoC Driver");
Axel Lin wrote:
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com
Acked-by: Timur Tabi timur@freescale.com
I tested the fsl_xxx.c changes, and everything still works (although I will miss my driver announcements). I compile-tested the mpc5200 changes, but I don't have an mpc5200 to test the code on.
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/omap/omap-hdmi.c | 12 +----------- sound/soc/omap/omap-mcbsp.c | 12 +----------- sound/soc/omap/omap-mcpdm.c | 12 +----------- sound/soc/omap/omap-pcm.c | 12 +----------- sound/soc/omap/omap4-hdmi-card.c | 12 +----------- 5 files changed, 5 insertions(+), 55 deletions(-)
diff --git a/sound/soc/omap/omap-hdmi.c b/sound/soc/omap/omap-hdmi.c index 9bb1cf8..38e0def 100644 --- a/sound/soc/omap/omap-hdmi.c +++ b/sound/soc/omap/omap-hdmi.c @@ -139,17 +139,7 @@ static struct platform_driver hdmi_dai_driver = { .remove = __devexit_p(omap_hdmi_remove), };
-static int __init hdmi_dai_init(void) -{ - return platform_driver_register(&hdmi_dai_driver); -} -module_init(hdmi_dai_init); - -static void __exit hdmi_dai_exit(void) -{ - platform_driver_unregister(&hdmi_dai_driver); -} -module_exit(hdmi_dai_exit); +module_platform_driver(hdmi_dai_driver);
MODULE_AUTHOR("Jorge Candelaria jorge.candelaria@ti.com"); MODULE_AUTHOR("Ricardo Neri ricardo.neri@ti.com"); diff --git a/sound/soc/omap/omap-mcbsp.c b/sound/soc/omap/omap-mcbsp.c index d91e6ef..bd11d25 100644 --- a/sound/soc/omap/omap-mcbsp.c +++ b/sound/soc/omap/omap-mcbsp.c @@ -785,17 +785,7 @@ static struct platform_driver asoc_mcbsp_driver = { .remove = __devexit_p(asoc_mcbsp_remove), };
-static int __init snd_omap_mcbsp_init(void) -{ - return platform_driver_register(&asoc_mcbsp_driver); -} -module_init(snd_omap_mcbsp_init); - -static void __exit snd_omap_mcbsp_exit(void) -{ - platform_driver_unregister(&asoc_mcbsp_driver); -} -module_exit(snd_omap_mcbsp_exit); +module_platform_driver(asoc_mcbsp_driver);
MODULE_AUTHOR("Jarkko Nikula jarkko.nikula@bitmer.com"); MODULE_DESCRIPTION("OMAP I2S SoC Interface"); diff --git a/sound/soc/omap/omap-mcpdm.c b/sound/soc/omap/omap-mcpdm.c index cc8ceff..b50ac60 100644 --- a/sound/soc/omap/omap-mcpdm.c +++ b/sound/soc/omap/omap-mcpdm.c @@ -520,17 +520,7 @@ static struct platform_driver asoc_mcpdm_driver = { .remove = __devexit_p(asoc_mcpdm_remove), };
-static int __init snd_omap_mcpdm_init(void) -{ - return platform_driver_register(&asoc_mcpdm_driver); -} -module_init(snd_omap_mcpdm_init); - -static void __exit snd_omap_mcpdm_exit(void) -{ - platform_driver_unregister(&asoc_mcpdm_driver); -} -module_exit(snd_omap_mcpdm_exit); +module_platform_driver(asoc_mcpdm_driver);
MODULE_AUTHOR("Misael Lopez Cruz misael.lopez@ti.com"); MODULE_DESCRIPTION("OMAP PDM SoC Interface"); diff --git a/sound/soc/omap/omap-pcm.c b/sound/soc/omap/omap-pcm.c index 6ede7dc..52a0f63 100644 --- a/sound/soc/omap/omap-pcm.c +++ b/sound/soc/omap/omap-pcm.c @@ -433,17 +433,7 @@ static struct platform_driver omap_pcm_driver = { .remove = __devexit_p(omap_pcm_remove), };
-static int __init snd_omap_pcm_init(void) -{ - return platform_driver_register(&omap_pcm_driver); -} -module_init(snd_omap_pcm_init); - -static void __exit snd_omap_pcm_exit(void) -{ - platform_driver_unregister(&omap_pcm_driver); -} -module_exit(snd_omap_pcm_exit); +module_platform_driver(omap_pcm_driver);
MODULE_AUTHOR("Jarkko Nikula jarkko.nikula@bitmer.com"); MODULE_DESCRIPTION("OMAP PCM DMA module"); diff --git a/sound/soc/omap/omap4-hdmi-card.c b/sound/soc/omap/omap4-hdmi-card.c index 8671261..52d471c 100644 --- a/sound/soc/omap/omap4-hdmi-card.c +++ b/sound/soc/omap/omap4-hdmi-card.c @@ -112,17 +112,7 @@ static struct platform_driver omap4_hdmi_driver = { .remove = __devexit_p(omap4_hdmi_remove), };
-static int __init omap4_hdmi_init(void) -{ - return platform_driver_register(&omap4_hdmi_driver); -} -module_init(omap4_hdmi_init); - -static void __exit omap4_hdmi_exit(void) -{ - platform_driver_unregister(&omap4_hdmi_driver); -} -module_exit(omap4_hdmi_exit); +module_platform_driver(omap4_hdmi_driver);
MODULE_AUTHOR("Ricardo Neri ricardo.neri@ti.com"); MODULE_DESCRIPTION("OMAP4 HDMI machine ASoC driver");
On 11/25/2011 04:12 AM, Axel Lin wrote:
Factor out some boilerplate code.
Signed-off-by: Axel Linaxel.lin@gmail.com
sound/soc/omap/omap-hdmi.c | 12 +----------- sound/soc/omap/omap-mcbsp.c | 12 +----------- sound/soc/omap/omap-mcpdm.c | 12 +----------- sound/soc/omap/omap-pcm.c | 12 +----------- sound/soc/omap/omap4-hdmi-card.c | 12 +----------- 5 files changed, 5 insertions(+), 55 deletions(-)
Acked-by: Jarkko Nikula jarkko.nikula@bitmer.com
On Friday 25 November 2011 10:12:16 Axel Lin wrote:
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com
sound/soc/omap/omap-hdmi.c | 12 +----------- sound/soc/omap/omap-mcbsp.c | 12 +----------- sound/soc/omap/omap-mcpdm.c | 12 +----------- sound/soc/omap/omap-pcm.c | 12 +----------- sound/soc/omap/omap4-hdmi-card.c | 12 +----------- 5 files changed, 5 insertions(+), 55 deletions(-)
I was just about to send the patch for this ;) Thanks,
Acked-by: Peter Ujfalusi peter.ujfalusi@ti.com
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/pxa/hx4700.c | 13 +------------ sound/soc/pxa/mioa701_wm9713.c | 13 +------------ sound/soc/pxa/palm27x.c | 13 +------------ sound/soc/pxa/pxa-ssp.c | 12 +----------- sound/soc/pxa/pxa2xx-ac97.c | 12 +----------- sound/soc/pxa/pxa2xx-pcm.c | 12 +----------- 6 files changed, 6 insertions(+), 69 deletions(-)
diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c index 65c1248..e32afaf 100644 --- a/sound/soc/pxa/hx4700.c +++ b/sound/soc/pxa/hx4700.c @@ -236,18 +236,7 @@ static struct platform_driver hx4700_audio_driver = { .remove = __devexit_p(hx4700_audio_remove), };
-static int __init hx4700_modinit(void) -{ - return platform_driver_register(&hx4700_audio_driver); -} -module_init(hx4700_modinit); - -static void __exit hx4700_modexit(void) -{ - platform_driver_unregister(&hx4700_audio_driver); -} - -module_exit(hx4700_modexit); +module_platform_driver(hx4700_audio_driver);
MODULE_AUTHOR("Philipp Zabel"); MODULE_DESCRIPTION("ALSA SoC iPAQ hx4700"); diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c index 0b8d1ee..0e73a7f 100644 --- a/sound/soc/pxa/mioa701_wm9713.c +++ b/sound/soc/pxa/mioa701_wm9713.c @@ -227,18 +227,7 @@ static struct platform_driver mioa701_wm9713_driver = { }, };
-static int __init mioa701_asoc_init(void) -{ - return platform_driver_register(&mioa701_wm9713_driver); -} - -static void __exit mioa701_asoc_exit(void) -{ - platform_driver_unregister(&mioa701_wm9713_driver); -} - -module_init(mioa701_asoc_init); -module_exit(mioa701_asoc_exit); +module_platform_driver(mioa701_wm9713_driver);
/* Module information */ MODULE_AUTHOR("Robert Jarzmik (rjarzmik@free.fr)"); diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c index 7edc1fb..f313eca 100644 --- a/sound/soc/pxa/palm27x.c +++ b/sound/soc/pxa/palm27x.c @@ -201,18 +201,7 @@ static struct platform_driver palm27x_wm9712_driver = { }, };
-static int __init palm27x_asoc_init(void) -{ - return platform_driver_register(&palm27x_wm9712_driver); -} - -static void __exit palm27x_asoc_exit(void) -{ - platform_driver_unregister(&palm27x_wm9712_driver); -} - -module_init(palm27x_asoc_init); -module_exit(palm27x_asoc_exit); +module_platform_driver(palm27x_wm9712_driver);
/* Module information */ MODULE_AUTHOR("Marek Vasut marek.vasut@gmail.com"); diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index 9c9a51e..a57cfbc 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@ -825,17 +825,7 @@ static struct platform_driver asoc_ssp_driver = { .remove = __devexit_p(asoc_ssp_remove), };
-static int __init pxa_ssp_init(void) -{ - return platform_driver_register(&asoc_ssp_driver); -} -module_init(pxa_ssp_init); - -static void __exit pxa_ssp_exit(void) -{ - platform_driver_unregister(&asoc_ssp_driver); -} -module_exit(pxa_ssp_exit); +module_platform_driver(asoc_ssp_driver);
/* Module information */ MODULE_AUTHOR("Mark Brown broonie@opensource.wolfsonmicro.com"); diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 3fec2f3..837ff34 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -263,17 +263,7 @@ static struct platform_driver pxa2xx_ac97_driver = { }, };
-static int __init pxa_ac97_init(void) -{ - return platform_driver_register(&pxa2xx_ac97_driver); -} -module_init(pxa_ac97_init); - -static void __exit pxa_ac97_exit(void) -{ - platform_driver_unregister(&pxa2xx_ac97_driver); -} -module_exit(pxa_ac97_exit); +module_platform_driver(pxa2xx_ac97_driver);
MODULE_AUTHOR("Nicolas Pitre"); MODULE_DESCRIPTION("AC97 driver for the Intel PXA2xx chip"); diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c index 600676f..fdd6bed 100644 --- a/sound/soc/pxa/pxa2xx-pcm.c +++ b/sound/soc/pxa/pxa2xx-pcm.c @@ -141,17 +141,7 @@ static struct platform_driver pxa_pcm_driver = { .remove = __devexit_p(pxa2xx_soc_platform_remove), };
-static int __init snd_pxa_pcm_init(void) -{ - return platform_driver_register(&pxa_pcm_driver); -} -module_init(snd_pxa_pcm_init); - -static void __exit snd_pxa_pcm_exit(void) -{ - platform_driver_unregister(&pxa_pcm_driver); -} -module_exit(snd_pxa_pcm_exit); +module_platform_driver(pxa_pcm_driver);
MODULE_AUTHOR("Nicolas Pitre"); MODULE_DESCRIPTION("Intel PXA2xx PCM DMA module");
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com
Looks good to me,
Acked-by: Marek Vasut marek.vasut@gmail.com
sound/soc/pxa/hx4700.c | 13 +------------ sound/soc/pxa/mioa701_wm9713.c | 13 +------------ sound/soc/pxa/palm27x.c | 13 +------------ sound/soc/pxa/pxa-ssp.c | 12 +----------- sound/soc/pxa/pxa2xx-ac97.c | 12 +----------- sound/soc/pxa/pxa2xx-pcm.c | 12 +----------- 6 files changed, 6 insertions(+), 69 deletions(-)
diff --git a/sound/soc/pxa/hx4700.c b/sound/soc/pxa/hx4700.c index 65c1248..e32afaf 100644 --- a/sound/soc/pxa/hx4700.c +++ b/sound/soc/pxa/hx4700.c @@ -236,18 +236,7 @@ static struct platform_driver hx4700_audio_driver = { .remove = __devexit_p(hx4700_audio_remove), };
-static int __init hx4700_modinit(void) -{
- return platform_driver_register(&hx4700_audio_driver);
-} -module_init(hx4700_modinit);
-static void __exit hx4700_modexit(void) -{
- platform_driver_unregister(&hx4700_audio_driver);
-}
-module_exit(hx4700_modexit); +module_platform_driver(hx4700_audio_driver);
MODULE_AUTHOR("Philipp Zabel"); MODULE_DESCRIPTION("ALSA SoC iPAQ hx4700"); diff --git a/sound/soc/pxa/mioa701_wm9713.c b/sound/soc/pxa/mioa701_wm9713.c index 0b8d1ee..0e73a7f 100644 --- a/sound/soc/pxa/mioa701_wm9713.c +++ b/sound/soc/pxa/mioa701_wm9713.c @@ -227,18 +227,7 @@ static struct platform_driver mioa701_wm9713_driver = { }, };
-static int __init mioa701_asoc_init(void) -{
- return platform_driver_register(&mioa701_wm9713_driver);
-}
-static void __exit mioa701_asoc_exit(void) -{
- platform_driver_unregister(&mioa701_wm9713_driver);
-}
-module_init(mioa701_asoc_init); -module_exit(mioa701_asoc_exit); +module_platform_driver(mioa701_wm9713_driver);
/* Module information */ MODULE_AUTHOR("Robert Jarzmik (rjarzmik@free.fr)"); diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c index 7edc1fb..f313eca 100644 --- a/sound/soc/pxa/palm27x.c +++ b/sound/soc/pxa/palm27x.c @@ -201,18 +201,7 @@ static struct platform_driver palm27x_wm9712_driver = { }, };
-static int __init palm27x_asoc_init(void) -{
- return platform_driver_register(&palm27x_wm9712_driver);
-}
-static void __exit palm27x_asoc_exit(void) -{
- platform_driver_unregister(&palm27x_wm9712_driver);
-}
-module_init(palm27x_asoc_init); -module_exit(palm27x_asoc_exit); +module_platform_driver(palm27x_wm9712_driver);
/* Module information */ MODULE_AUTHOR("Marek Vasut marek.vasut@gmail.com"); diff --git a/sound/soc/pxa/pxa-ssp.c b/sound/soc/pxa/pxa-ssp.c index 9c9a51e..a57cfbc 100644 --- a/sound/soc/pxa/pxa-ssp.c +++ b/sound/soc/pxa/pxa-ssp.c @@ -825,17 +825,7 @@ static struct platform_driver asoc_ssp_driver = { .remove = __devexit_p(asoc_ssp_remove), };
-static int __init pxa_ssp_init(void) -{
- return platform_driver_register(&asoc_ssp_driver);
-} -module_init(pxa_ssp_init);
-static void __exit pxa_ssp_exit(void) -{
- platform_driver_unregister(&asoc_ssp_driver);
-} -module_exit(pxa_ssp_exit); +module_platform_driver(asoc_ssp_driver);
/* Module information */ MODULE_AUTHOR("Mark Brown broonie@opensource.wolfsonmicro.com"); diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 3fec2f3..837ff34 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c @@ -263,17 +263,7 @@ static struct platform_driver pxa2xx_ac97_driver = { }, };
-static int __init pxa_ac97_init(void) -{
- return platform_driver_register(&pxa2xx_ac97_driver);
-} -module_init(pxa_ac97_init);
-static void __exit pxa_ac97_exit(void) -{
- platform_driver_unregister(&pxa2xx_ac97_driver);
-} -module_exit(pxa_ac97_exit); +module_platform_driver(pxa2xx_ac97_driver);
MODULE_AUTHOR("Nicolas Pitre"); MODULE_DESCRIPTION("AC97 driver for the Intel PXA2xx chip"); diff --git a/sound/soc/pxa/pxa2xx-pcm.c b/sound/soc/pxa/pxa2xx-pcm.c index 600676f..fdd6bed 100644 --- a/sound/soc/pxa/pxa2xx-pcm.c +++ b/sound/soc/pxa/pxa2xx-pcm.c @@ -141,17 +141,7 @@ static struct platform_driver pxa_pcm_driver = { .remove = __devexit_p(pxa2xx_soc_platform_remove), };
-static int __init snd_pxa_pcm_init(void) -{
- return platform_driver_register(&pxa_pcm_driver);
-} -module_init(snd_pxa_pcm_init);
-static void __exit snd_pxa_pcm_exit(void) -{
- platform_driver_unregister(&pxa_pcm_driver);
-} -module_exit(snd_pxa_pcm_exit); +module_platform_driver(pxa_pcm_driver);
MODULE_AUTHOR("Nicolas Pitre"); MODULE_DESCRIPTION("Intel PXA2xx PCM DMA module");
----- Mail original ----- De: "Marek Vasut" marek.vasut@gmail.com À: "Axel Lin" axel.lin@gmail.com
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com Acked-by: Marek Vasut marek.vasut@gmail.com
Good to me too. Acked-by: Robert Jarzmik robert.jarzmik@free.fr
Cheers.
-- Robert
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/sh/dma-sh7760.c | 12 +----------- sound/soc/sh/fsi-ak4642.c | 13 +------------ sound/soc/sh/fsi-hdmi.c | 13 +------------ sound/soc/sh/fsi.c | 13 +------------ sound/soc/sh/hac.c | 12 +----------- sound/soc/sh/siu_dai.c | 13 +------------ sound/soc/sh/ssi.c | 12 +----------- 7 files changed, 7 insertions(+), 81 deletions(-)
diff --git a/sound/soc/sh/dma-sh7760.c b/sound/soc/sh/dma-sh7760.c index db74005..7da2018 100644 --- a/sound/soc/sh/dma-sh7760.c +++ b/sound/soc/sh/dma-sh7760.c @@ -369,17 +369,7 @@ static struct platform_driver sh7760_pcm_driver = { .remove = __devexit_p(sh7760_soc_platform_remove), };
-static int __init snd_sh7760_pcm_init(void) -{ - return platform_driver_register(&sh7760_pcm_driver); -} -module_init(snd_sh7760_pcm_init); - -static void __exit snd_sh7760_pcm_exit(void) -{ - platform_driver_unregister(&sh7760_pcm_driver); -} -module_exit(snd_sh7760_pcm_exit); +module_platform_driver(sh7760_pcm_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("SH7760 Audio DMA (DMABRG) driver"); diff --git a/sound/soc/sh/fsi-ak4642.c b/sound/soc/sh/fsi-ak4642.c index dff64b9..d81de3d 100644 --- a/sound/soc/sh/fsi-ak4642.c +++ b/sound/soc/sh/fsi-ak4642.c @@ -192,18 +192,7 @@ static struct platform_driver fsi_ak4642 = { .id_table = fsi_id_table, };
-static int __init fsi_ak4642_init(void) -{ - return platform_driver_register(&fsi_ak4642); -} - -static void __exit fsi_ak4642_exit(void) -{ - platform_driver_unregister(&fsi_ak4642); -} - -module_init(fsi_ak4642_init); -module_exit(fsi_ak4642_exit); +module_platform_driver(fsi_ak4642);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic SH4 FSI-AK4642 sound card"); diff --git a/sound/soc/sh/fsi-hdmi.c b/sound/soc/sh/fsi-hdmi.c index 3ebebe7..621aea1 100644 --- a/sound/soc/sh/fsi-hdmi.c +++ b/sound/soc/sh/fsi-hdmi.c @@ -110,18 +110,7 @@ static struct platform_driver fsi_hdmi = { .id_table = fsi_id_table, };
-static int __init fsi_hdmi_init(void) -{ - return platform_driver_register(&fsi_hdmi); -} - -static void __exit fsi_hdmi_exit(void) -{ - platform_driver_unregister(&fsi_hdmi); -} - -module_init(fsi_hdmi_init); -module_exit(fsi_hdmi_exit); +module_platform_driver(fsi_hdmi);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("Generic SH4 FSI-HDMI sound card"); diff --git a/sound/soc/sh/fsi.c b/sound/soc/sh/fsi.c index aa30330..a27c306 100644 --- a/sound/soc/sh/fsi.c +++ b/sound/soc/sh/fsi.c @@ -1468,18 +1468,7 @@ static struct platform_driver fsi_driver = { .id_table = fsi_id_table, };
-static int __init fsi_mobile_init(void) -{ - return platform_driver_register(&fsi_driver); -} - -static void __exit fsi_mobile_exit(void) -{ - platform_driver_unregister(&fsi_driver); -} - -module_init(fsi_mobile_init); -module_exit(fsi_mobile_exit); +module_platform_driver(fsi_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("SuperH onchip FSI audio driver"); diff --git a/sound/soc/sh/hac.c b/sound/soc/sh/hac.c index a1f307b..3474d7b 100644 --- a/sound/soc/sh/hac.c +++ b/sound/soc/sh/hac.c @@ -332,17 +332,7 @@ static struct platform_driver hac_pcm_driver = { .remove = __devexit_p(hac_soc_platform_remove), };
-static int __init sh4_hac_pcm_init(void) -{ - return platform_driver_register(&hac_pcm_driver); -} -module_init(sh4_hac_pcm_init); - -static void __exit sh4_hac_pcm_exit(void) -{ - platform_driver_unregister(&hac_pcm_driver); -} -module_exit(sh4_hac_pcm_exit); +module_platform_driver(hac_pcm_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("SuperH onchip HAC (AC97) audio driver"); diff --git a/sound/soc/sh/siu_dai.c b/sound/soc/sh/siu_dai.c index 93dea49..11c6085 100644 --- a/sound/soc/sh/siu_dai.c +++ b/sound/soc/sh/siu_dai.c @@ -852,18 +852,7 @@ static struct platform_driver siu_driver = { .remove = __devexit_p(siu_remove), };
-static int __init siu_init(void) -{ - return platform_driver_register(&siu_driver); -} - -static void __exit siu_exit(void) -{ - platform_driver_unregister(&siu_driver); -} - -module_init(siu_init) -module_exit(siu_exit) +module_platform_driver(siu_driver);
MODULE_AUTHOR("Carlos Munoz carlos@kenati.com"); MODULE_DESCRIPTION("ALSA SoC SH7722 SIU driver"); diff --git a/sound/soc/sh/ssi.c b/sound/soc/sh/ssi.c index 1fda16a..ff82b56 100644 --- a/sound/soc/sh/ssi.c +++ b/sound/soc/sh/ssi.c @@ -401,17 +401,7 @@ static struct platform_driver sh4_ssi_driver = { .remove = __devexit_p(sh4_soc_dai_remove), };
-static int __init snd_sh4_ssi_init(void) -{ - return platform_driver_register(&sh4_ssi_driver); -} -module_init(snd_sh4_ssi_init); - -static void __exit snd_sh4_ssi_exit(void) -{ - platform_driver_unregister(&sh4_ssi_driver); -} -module_exit(snd_sh4_ssi_exit); +module_platform_driver(sh4_ssi_driver);
MODULE_LICENSE("GPL"); MODULE_DESCRIPTION("SuperH onchip SSI (I2S) audio driver");
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com --- sound/soc/txx9/txx9aclc-ac97.c | 13 +------------ sound/soc/txx9/txx9aclc.c | 12 +----------- 2 files changed, 2 insertions(+), 23 deletions(-)
diff --git a/sound/soc/txx9/txx9aclc-ac97.c b/sound/soc/txx9/txx9aclc-ac97.c index a4e3f55..28db4ca 100644 --- a/sound/soc/txx9/txx9aclc-ac97.c +++ b/sound/soc/txx9/txx9aclc-ac97.c @@ -223,18 +223,7 @@ static struct platform_driver txx9aclc_ac97_driver = { }, };
-static int __init txx9aclc_ac97_init(void) -{ - return platform_driver_register(&txx9aclc_ac97_driver); -} - -static void __exit txx9aclc_ac97_exit(void) -{ - platform_driver_unregister(&txx9aclc_ac97_driver); -} - -module_init(txx9aclc_ac97_init); -module_exit(txx9aclc_ac97_exit); +module_platform_driver(txx9aclc_ac97_driver);
MODULE_AUTHOR("Atsushi Nemoto anemo@mba.ocn.ne.jp"); MODULE_DESCRIPTION("TXx9 ACLC AC97 driver"); diff --git a/sound/soc/txx9/txx9aclc.c b/sound/soc/txx9/txx9aclc.c index 602bb68..2155461 100644 --- a/sound/soc/txx9/txx9aclc.c +++ b/sound/soc/txx9/txx9aclc.c @@ -438,17 +438,7 @@ static struct platform_driver txx9aclc_pcm_driver = { .remove = __devexit_p(txx9aclc_soc_platform_remove), };
-static int __init snd_txx9aclc_pcm_init(void) -{ - return platform_driver_register(&txx9aclc_pcm_driver); -} -module_init(snd_txx9aclc_pcm_init); - -static void __exit snd_txx9aclc_pcm_exit(void) -{ - platform_driver_unregister(&txx9aclc_pcm_driver); -} -module_exit(snd_txx9aclc_pcm_exit); +module_platform_driver(txx9aclc_pcm_driver);
MODULE_AUTHOR("Atsushi Nemoto anemo@mba.ocn.ne.jp"); MODULE_DESCRIPTION("TXx9 ACLC Audio DMA driver");
On 11/25/2011 03:05 AM, Axel Lin :
Factor out some boilerplate code.
Signed-off-by: Axel Lin axel.lin@gmail.com
Acked-by: Nicolas Ferre nicolas.ferre@atmel.com
sound/soc/atmel/atmel-pcm.c | 12 +----------- sound/soc/atmel/atmel_ssc_dai.c | 12 +----------- 2 files changed, 2 insertions(+), 22 deletions(-)
diff --git a/sound/soc/atmel/atmel-pcm.c b/sound/soc/atmel/atmel-pcm.c index f81d4c3..60de055 100644 --- a/sound/soc/atmel/atmel-pcm.c +++ b/sound/soc/atmel/atmel-pcm.c @@ -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"); diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c index a67fc9b..354341e 100644 --- a/sound/soc/atmel/atmel_ssc_dai.c +++ b/sound/soc/atmel/atmel_ssc_dai.c @@ -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");
participants (9)
-
Axel Lin
-
Jarkko Nikula
-
Manuel Lauss
-
Marek Vasut
-
Mark Brown
-
Nicolas Ferre
-
Péter Ujfalusi
-
robert.jarzmik@free.fr
-
Timur Tabi