drivers: net: cpsw: use module_platform_driver
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / ti / cpsw.c
index c670317f3cb051f96b0a90ec9bb957c5c05376b8..55d2d8577d075719cc28e61430bbb1414e3750c8 100644 (file)
@@ -1784,7 +1784,6 @@ static void cpsw_get_drvinfo(struct net_device *ndev,
        strlcpy(info->driver, "cpsw", sizeof(info->driver));
        strlcpy(info->version, "1.0", sizeof(info->version));
        strlcpy(info->bus_info, priv->pdev->name, sizeof(info->bus_info));
-       info->regdump_len = cpsw_get_regs_len(ndev);
 }
 
 static u32 cpsw_get_msglevel(struct net_device *ndev)
@@ -2058,13 +2057,10 @@ no_phy_slave:
                if (mac_addr) {
                        memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN);
                } else {
-                       if (of_machine_is_compatible("ti,am33xx")) {
-                               ret = cpsw_am33xx_cm_get_macid(&pdev->dev,
-                                                       0x630, i,
-                                                       slave_data->mac_addr);
-                               if (ret)
-                                       return ret;
-                       }
+                       ret = ti_cm_get_macid(&pdev->dev, i,
+                                             slave_data->mac_addr);
+                       if (ret)
+                               return ret;
                }
                if (data->dual_emac) {
                        if (of_property_read_u32(slave_node, "dual_emac_res_vlan",
@@ -2587,17 +2583,7 @@ static struct platform_driver cpsw_driver = {
        .remove = cpsw_remove,
 };
 
-static int __init cpsw_init(void)
-{
-       return platform_driver_register(&cpsw_driver);
-}
-late_initcall(cpsw_init);
-
-static void __exit cpsw_exit(void)
-{
-       platform_driver_unregister(&cpsw_driver);
-}
-module_exit(cpsw_exit);
+module_platform_driver(cpsw_driver);
 
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Cyril Chemparathy <cyril@ti.com>");