net: dsa: qca8k: use mdio_module_driver to simplify the code
authorWei Yongjun <weiyongjun1@huawei.com>
Wed, 21 Sep 2016 15:05:05 +0000 (15:05 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 22 Sep 2016 07:17:34 +0000 (03:17 -0400)
mdio_module_driver() makes the code simpler by eliminating
boilerplate code.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/qca8k.c

index 6fc379cf12e96d94ce5bbc343b011bcc5d1075a2..b3df70d07ff632f85517968716248f751ce59836 100644 (file)
@@ -1032,19 +1032,7 @@ static struct mdio_driver qca8kmdio_driver = {
        },
 };
 
-static int __init
-qca8kmdio_driver_register(void)
-{
-       return mdio_driver_register(&qca8kmdio_driver);
-}
-module_init(qca8kmdio_driver_register);
-
-static void __exit
-qca8kmdio_driver_unregister(void)
-{
-       mdio_driver_unregister(&qca8kmdio_driver);
-}
-module_exit(qca8kmdio_driver_unregister);
+mdio_module_driver(qca8kmdio_driver);
 
 MODULE_AUTHOR("Mathieu Olivari, John Crispin <john@phrozen.org>");
 MODULE_DESCRIPTION("Driver for QCA8K ethernet switch family");