Changeset 30739 for branches/backfire


Ignore:
Timestamp:
2012-02-27T12:06:17+01:00 (4 years ago)
Author:
nbd
Message:

generic: rtl8366{s,rb}: remove the PHY driver. (backport of r26600)

Since the PHY driver is only used for the WAN port and there is virtually
no difference between it and the generic PHY driver, we can sefely remove
it.

Signed-off-by: Jonas Gorski <jonas.gorski+openwrt@…>

Location:
branches/backfire/target/linux/generic-2.6/files/drivers/net/phy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/backfire/target/linux/generic-2.6/files/drivers/net/phy/rtl8366rb.c

    r27815 r30739  
    2727#define RTL8366RB_PHY_PAGE_MAX  7 
    2828#define RTL8366RB_PHY_ADDR_MAX  31 
    29 #define RTL8366RB_PHY_WAN       4 
    3029 
    3130/* Switch Global Configuration register */ 
     
    11581157} 
    11591158 
    1160 static int rtl8366rb_mii_bus_match(struct mii_bus *bus) 
    1161 { 
    1162         return (bus->read == rtl8366rb_mii_read && 
    1163                 bus->write == rtl8366rb_mii_write); 
    1164 } 
    1165  
    11661159static int rtl8366rb_setup(struct rtl8366_smi *smi) 
    11671160{ 
     
    12831276} 
    12841277 
    1285 static int rtl8366rb_phy_config_init(struct phy_device *phydev) 
    1286 { 
    1287         if (!rtl8366rb_mii_bus_match(phydev->bus)) 
    1288                 return -EINVAL; 
    1289  
    1290         return 0; 
    1291 } 
    1292  
    1293 static int rtl8366rb_phy_config_aneg(struct phy_device *phydev) 
    1294 { 
    1295         /* phy 4 might be connected to a second mac, allow aneg config */ 
    1296         if (phydev->addr == RTL8366RB_PHY_WAN) 
    1297                 return genphy_config_aneg(phydev); 
    1298  
    1299         return 0; 
    1300 } 
    1301  
    1302 static struct phy_driver rtl8366rb_phy_driver = { 
    1303         .phy_id         = 0x001cc960, 
    1304         .name           = "Realtek RTL8366RB", 
    1305         .phy_id_mask    = 0x1ffffff0, 
    1306         .features       = PHY_GBIT_FEATURES, 
    1307         .config_aneg    = rtl8366rb_phy_config_aneg, 
    1308         .config_init    = rtl8366rb_phy_config_init, 
    1309         .read_status    = genphy_read_status, 
    1310         .driver         = { 
    1311                 .owner = THIS_MODULE, 
    1312         }, 
    1313 }; 
    1314  
    13151278static int __devexit rtl8366rb_remove(struct platform_device *pdev) 
    13161279{ 
     
    13381301static int __init rtl8366rb_module_init(void) 
    13391302{ 
    1340         int ret; 
    1341         ret = platform_driver_register(&rtl8366rb_driver); 
    1342         if (ret) 
    1343                 return ret; 
    1344  
    1345         ret = phy_driver_register(&rtl8366rb_phy_driver); 
    1346         if (ret) 
    1347                 goto err_platform_unregister; 
    1348  
    1349         return 0; 
    1350  
    1351  err_platform_unregister: 
    1352         platform_driver_unregister(&rtl8366rb_driver); 
    1353         return ret; 
     1303        return platform_driver_register(&rtl8366rb_driver); 
    13541304} 
    13551305module_init(rtl8366rb_module_init); 
     
    13571307static void __exit rtl8366rb_module_exit(void) 
    13581308{ 
    1359         phy_driver_unregister(&rtl8366rb_phy_driver); 
    13601309        platform_driver_unregister(&rtl8366rb_driver); 
    13611310} 
  • branches/backfire/target/linux/generic-2.6/files/drivers/net/phy/rtl8366s.c

    r27815 r30739  
    2626#define RTL8366S_PHY_PAGE_MAX   7 
    2727#define RTL8366S_PHY_ADDR_MAX   31 
    28 #define RTL8366S_PHY_WAN        4 
    2928 
    3029/* Switch Global Configuration register */ 
     
    987986} 
    988987 
    989 static int rtl8366s_mii_bus_match(struct mii_bus *bus) 
    990 { 
    991         return (bus->read == rtl8366s_mii_read && 
    992                 bus->write == rtl8366s_mii_write); 
    993 } 
    994  
    995988static int rtl8366s_setup(struct rtl8366_smi *smi) 
    996989{ 
     
    11121105} 
    11131106 
    1114 static int rtl8366s_phy_config_init(struct phy_device *phydev) 
    1115 { 
    1116         if (!rtl8366s_mii_bus_match(phydev->bus)) 
    1117                 return -EINVAL; 
    1118  
    1119         return 0; 
    1120 } 
    1121  
    1122 static int rtl8366s_phy_config_aneg(struct phy_device *phydev) 
    1123 { 
    1124         /* phy 4 might be connected to a second mac, allow aneg config */ 
    1125         if (phydev->addr == RTL8366S_PHY_WAN) 
    1126                 return genphy_config_aneg(phydev); 
    1127  
    1128         return 0; 
    1129 } 
    1130  
    1131 static struct phy_driver rtl8366s_phy_driver = { 
    1132         .phy_id         = 0x001cc960, 
    1133         .name           = "Realtek RTL8366S", 
    1134         .phy_id_mask    = 0x1ffffff0, 
    1135         .features       = PHY_GBIT_FEATURES, 
    1136         .config_aneg    = rtl8366s_phy_config_aneg, 
    1137         .config_init    = rtl8366s_phy_config_init, 
    1138         .read_status    = genphy_read_status, 
    1139         .driver         = { 
    1140                 .owner = THIS_MODULE, 
    1141         }, 
    1142 }; 
    1143  
    11441107static int __devexit rtl8366s_remove(struct platform_device *pdev) 
    11451108{ 
     
    11671130static int __init rtl8366s_module_init(void) 
    11681131{ 
    1169         int ret; 
    1170         ret = platform_driver_register(&rtl8366s_driver); 
    1171         if (ret) 
    1172                 return ret; 
    1173  
    1174         ret = phy_driver_register(&rtl8366s_phy_driver); 
    1175         if (ret) 
    1176                 goto err_platform_unregister; 
    1177  
    1178         return 0; 
    1179  
    1180  err_platform_unregister: 
    1181         platform_driver_unregister(&rtl8366s_driver); 
    1182         return ret; 
     1132        return platform_driver_register(&rtl8366s_driver); 
    11831133} 
    11841134module_init(rtl8366s_module_init); 
     
    11861136static void __exit rtl8366s_module_exit(void) 
    11871137{ 
    1188         phy_driver_unregister(&rtl8366s_phy_driver); 
    11891138        platform_driver_unregister(&rtl8366s_driver); 
    11901139} 
Note: See TracChangeset for help on using the changeset viewer.