net: ftgmac100: Use module_platform_driver()
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 18 Mar 2013 01:50:48 +0000 (01:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Mar 2013 17:02:37 +0000 (13:02 -0400)
module_platform_driver macro removes some boilerplate and makes
the code simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Po-Yu Chuang <ratbert@faraday-tech.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/faraday/ftgmac100.c

index 0e817e6084e96f52d22a6d27cccda9a34d03600f..21b85fb7d05f68da25f7980b937e61b1c4d9de56 100644 (file)
@@ -1349,22 +1349,7 @@ static struct platform_driver ftgmac100_driver = {
        },
 };
 
-/******************************************************************************
- * initialization / finalization
- *****************************************************************************/
-static int __init ftgmac100_init(void)
-{
-       pr_info("Loading version " DRV_VERSION " ...\n");
-       return platform_driver_register(&ftgmac100_driver);
-}
-
-static void __exit ftgmac100_exit(void)
-{
-       platform_driver_unregister(&ftgmac100_driver);
-}
-
-module_init(ftgmac100_init);
-module_exit(ftgmac100_exit);
+module_platform_driver(ftgmac100_driver);
 
 MODULE_AUTHOR("Po-Yu Chuang <ratbert@faraday-tech.com>");
 MODULE_DESCRIPTION("FTGMAC100 driver");