Yoshihiro Shimoda says: ==================== rswitch: Fix issues on specific conditions This patch series fix some issues of rswitch driver on specific condtions. ====================
Unified · Split
| @@ -1254,7 +1254,7 @@ static void rswitch_adjust_link(struct net_device *ndev) · 1253 unmodified lines | ||
| 1254 | 1254 | phy_print_status(phydev); |
| 1255 | 1255 | if (phydev->link) |
| 1256 | 1256 | phy_power_on(rdev->serdes); |
| 1257 | − else | |
| 1257 | + else if (rdev->serdes->power_count) | |
| 1258 | 1258 | phy_power_off(rdev->serdes); |
| 1259 | 1259 | |
| 1260 | 1260 | rdev->etha->link = phydev->link; |
| @@ -1964,15 +1964,17 @@ static void rswitch_deinit(struct rswitch_private *priv) · 703 unmodified lines | ||
| 1964 | 1964 | rswitch_gwca_hw_deinit(priv); |
| 1965 | 1965 | rcar_gen4_ptp_unregister(priv->ptp_priv); |
| 1966 | 1966 | |
| 1967 | − for (i = 0; i < RSWITCH_NUM_PORTS; i++) { | |
| 1967 | + rswitch_for_each_enabled_port(priv, i) { | |
| 1968 | 1968 | struct rswitch_device *rdev = priv->rdev[i]; |
| 1969 | 1969 | |
| 1970 | − phy_exit(priv->rdev[i]->serdes); | |
| 1971 | − rswitch_ether_port_deinit_one(rdev); | |
| 1972 | 1970 | unregister_netdev(rdev->ndev); |
| 1973 | − rswitch_device_free(priv, i); | |
| 1971 | + rswitch_ether_port_deinit_one(rdev); | |
| 1972 | + phy_exit(priv->rdev[i]->serdes); | |
| 1974 | 1973 | } |
| 1975 | 1974 | |
| 1975 | + for (i = 0; i < RSWITCH_NUM_PORTS; i++) | |
| 1976 | + rswitch_device_free(priv, i); | |
| 1977 | + | |
| 1976 | 1978 | rswitch_gwca_ts_queue_free(priv); |
| 1977 | 1979 | rswitch_gwca_linkfix_free(priv); |
| 1978 | 1980 | |