wan/fsl_ucc_hdlc: use module_platform_driver to simplify the code
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Tue, 19 Jul 2016 11:25:16 +0000 (11:25 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 20 Jul 2016 21:46:00 +0000 (14:46 -0700)
module_platform_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/wan/fsl_ucc_hdlc.c

index 10ca49797e342b4eeec17a4b8c7a813e4c1a4952..2fc50ec453d05c369c4702b6a3f73e2e0095134a 100644 (file)
@@ -1174,15 +1174,4 @@ static struct platform_driver ucc_hdlc_driver = {
        },
 };
 
-static int __init ucc_hdlc_init(void)
-{
-       return platform_driver_register(&ucc_hdlc_driver);
-}
-
-static void __exit ucc_hdlc_exit(void)
-{
-       platform_driver_unregister(&ucc_hdlc_driver);
-}
-
-module_init(ucc_hdlc_init);
-module_exit(ucc_hdlc_exit);
+module_platform_driver(ucc_hdlc_driver);