Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / s6gmac.c
index 21683e2b1ff412817213fa206416a6813235367d..b6739afeaca1517bf3351dae9e3a33469cccc46e 100644 (file)
@@ -998,6 +998,7 @@ static int s6gmac_probe(struct platform_device *pdev)
        mb = mdiobus_alloc();
        if (!mb) {
                printk(KERN_ERR DRV_PRMT "error allocating mii bus\n");
+               res = -ENOMEM;
                goto errmii;
        }
        mb->name = "s6gmac_mii";
@@ -1053,20 +1054,7 @@ static struct platform_driver s6gmac_driver = {
        },
 };
 
-static int __init s6gmac_init(void)
-{
-       printk(KERN_INFO DRV_PRMT "S6 GMAC ethernet driver\n");
-       return platform_driver_register(&s6gmac_driver);
-}
-
-
-static void __exit s6gmac_exit(void)
-{
-       platform_driver_unregister(&s6gmac_driver);
-}
-
-module_init(s6gmac_init);
-module_exit(s6gmac_exit);
+module_platform_driver(s6gmac_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_DESCRIPTION("S6105 on chip Ethernet driver");