summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@armlinux.org.uk>2017-04-14 15:10:05 +0100
committerRussell King <rmk+kernel@armlinux.org.uk>2017-05-09 18:08:27 +0100
commit2546b8933d66fdec4ece43606d46f395b6e550e3 (patch)
treea9f529997ace537a9544ac9afc450b18399376c6
parent2be309597dd4adc42a25c6c23e600cc28711091b (diff)
sfp: ensure module starts with tx disabled
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
-rw-r--r--drivers/net/phy/sfp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 1f5edc351b2d..294f59e140b0 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -1236,10 +1236,11 @@ static int sfp_probe(struct platform_device *pdev)
phylink_register_module(sfp->phylink, sfp, &sfp_module_ops);
}
- sfp->state = sfp_get_state(sfp);
- if (sfp->gpio[GPIO_TX_DISABLE] &&
- gpiod_get_value_cansleep(sfp->gpio[GPIO_TX_DISABLE]))
- sfp->state |= SFP_F_TX_DISABLE;
+ /* Get the initial state, and always signal TX disable,
+ * since the network interface will not be up.
+ */
+ sfp->state = sfp_get_state(sfp) | SFP_F_TX_DISABLE;
+
if (sfp->gpio[GPIO_RATE_SELECT] &&
gpiod_get_value_cansleep(sfp->gpio[GPIO_RATE_SELECT]))
sfp->state |= SFP_F_RATE_SELECT;