[PATCH -next] ASoC: imx-audio-rpmsg: use module_rpmsg_driver to simplify the code
From: Yang Yingliang
Date: Wed Jun 02 2021 - 04:21:56 EST
module_rpmsg_driver() makes the code simpler by eliminating
boilerplate code.
Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
---
sound/soc/fsl/imx-audio-rpmsg.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/sound/soc/fsl/imx-audio-rpmsg.c b/sound/soc/fsl/imx-audio-rpmsg.c
index 50099bcaa9cd..905c3a071300 100644
--- a/sound/soc/fsl/imx-audio-rpmsg.c
+++ b/sound/soc/fsl/imx-audio-rpmsg.c
@@ -122,17 +122,7 @@ static struct rpmsg_driver imx_audio_rpmsg_driver = {
.remove = imx_audio_rpmsg_remove,
};
-static int __init imx_audio_rpmsg_init(void)
-{
- return register_rpmsg_driver(&imx_audio_rpmsg_driver);
-}
-
-static void __exit imx_audio_rpmsg_exit(void)
-{
- unregister_rpmsg_driver(&imx_audio_rpmsg_driver);
-}
-module_init(imx_audio_rpmsg_init);
-module_exit(imx_audio_rpmsg_exit);
+module_rpmsg_driver(imx_audio_rpmsg_driver);
MODULE_DESCRIPTION("Freescale SoC Audio RPMSG interface");
MODULE_AUTHOR("Shengjiu Wang <shengjiu.wang@xxxxxxx>");
--
2.25.1