Skip to content

Commit

Permalink
ASoC: Convert mxs directory to module_platform_driver
Browse files Browse the repository at this point in the history
Factor out some boilerplate code.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Axel Lin authored and Mark Brown committed Nov 24, 2011
1 parent 880dd72 commit 85aa096
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 33 deletions.
12 changes: 1 addition & 11 deletions sound/soc/mxs/mxs-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,14 +346,4 @@ static struct platform_driver mxs_pcm_driver = {
.remove = __devexit_p(mxs_soc_platform_remove),
};

static int __init snd_mxs_pcm_init(void)
{
return platform_driver_register(&mxs_pcm_driver);
}
module_init(snd_mxs_pcm_init);

static void __exit snd_mxs_pcm_exit(void)
{
platform_driver_unregister(&mxs_pcm_driver);
}
module_exit(snd_mxs_pcm_exit);
module_platform_driver(mxs_pcm_driver);
12 changes: 1 addition & 11 deletions sound/soc/mxs/mxs-saif.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,18 +781,8 @@ static struct platform_driver mxs_saif_driver = {
},
};

static int __init mxs_saif_init(void)
{
return platform_driver_register(&mxs_saif_driver);
}

static void __exit mxs_saif_exit(void)
{
platform_driver_unregister(&mxs_saif_driver);
}
module_platform_driver(mxs_saif_driver);

module_init(mxs_saif_init);
module_exit(mxs_saif_exit);
MODULE_AUTHOR("Freescale Semiconductor, Inc.");
MODULE_DESCRIPTION("MXS ASoC SAIF driver");
MODULE_LICENSE("GPL");
12 changes: 1 addition & 11 deletions sound/soc/mxs/mxs-sgtl5000.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,7 @@ static struct platform_driver mxs_sgtl5000_audio_driver = {
.remove = __devexit_p(mxs_sgtl5000_remove),
};

static int __init mxs_sgtl5000_init(void)
{
return platform_driver_register(&mxs_sgtl5000_audio_driver);
}
module_init(mxs_sgtl5000_init);

static void __exit mxs_sgtl5000_exit(void)
{
platform_driver_unregister(&mxs_sgtl5000_audio_driver);
}
module_exit(mxs_sgtl5000_exit);
module_platform_driver(mxs_sgtl5000_audio_driver);

MODULE_AUTHOR("Freescale Semiconductor, Inc.");
MODULE_DESCRIPTION("MXS ALSA SoC Machine driver");
Expand Down

0 comments on commit 85aa096

Please sign in to comment.