diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2019-11-10 14:06:18 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-11-11 16:17:00 -0800 |
commit | 1539e0d33bbc948351e340daaff1f9d98acb3dde (patch) | |
tree | 3c0e195127d0de03f38f355367744804375fb8f9 | |
parent | e85d81a1840a000adc00ed75be553b886660884f (diff) |
net: sfp: move tx disable on device down to main state machine
Move the tx disable assertion on device down to the main state
machine.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/phy/sfp.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c index 9d341ab4c96b..04169681dd86 100644 --- a/drivers/net/phy/sfp.c +++ b/drivers/net/phy/sfp.c @@ -1554,15 +1554,8 @@ static void sfp_sm_device(struct sfp *sfp, unsigned int event) break; case SFP_DEV_UP: - if (event == SFP_E_DEV_DOWN) { - /* If the module has a PHY, avoid raising TX disable - * as this resets the PHY. Otherwise, raise it to - * turn the laser off. - */ - if (!sfp->mod_phy) - sfp_module_tx_disable(sfp); + if (event == SFP_E_DEV_DOWN) sfp->sm_dev_state = SFP_DEV_DOWN; - } break; } } @@ -1624,6 +1617,7 @@ static void sfp_sm_main(struct sfp *sfp, unsigned int event) sfp_sm_link_down(sfp); if (sfp->mod_phy) sfp_sm_phy_detach(sfp); + sfp_module_tx_disable(sfp); sfp_sm_next(sfp, SFP_S_DOWN, 0); return; } |