diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/dsa/slave.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/dsa/slave.c b/net/dsa/slave.c index d104ae15836f..f23deadf42a0 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c | |||
@@ -521,10 +521,13 @@ static int dsa_slave_phy_setup(struct dsa_slave_priv *p, | |||
521 | struct device_node *phy_dn, *port_dn; | 521 | struct device_node *phy_dn, *port_dn; |
522 | bool phy_is_fixed = false; | 522 | bool phy_is_fixed = false; |
523 | u32 phy_flags = 0; | 523 | u32 phy_flags = 0; |
524 | int ret; | 524 | int mode, ret; |
525 | 525 | ||
526 | port_dn = cd->port_dn[p->port]; | 526 | port_dn = cd->port_dn[p->port]; |
527 | p->phy_interface = of_get_phy_mode(port_dn); | 527 | mode = of_get_phy_mode(port_dn); |
528 | if (mode < 0) | ||
529 | mode = PHY_INTERFACE_MODE_NA; | ||
530 | p->phy_interface = mode; | ||
528 | 531 | ||
529 | phy_dn = of_parse_phandle(port_dn, "phy-handle", 0); | 532 | phy_dn = of_parse_phandle(port_dn, "phy-handle", 0); |
530 | if (of_phy_is_fixed_link(port_dn)) { | 533 | if (of_phy_is_fixed_link(port_dn)) { |
@@ -559,6 +562,8 @@ static int dsa_slave_phy_setup(struct dsa_slave_priv *p, | |||
559 | if (!p->phy) | 562 | if (!p->phy) |
560 | return -ENODEV; | 563 | return -ENODEV; |
561 | 564 | ||
565 | /* Use already configured phy mode */ | ||
566 | p->phy_interface = p->phy->interface; | ||
562 | phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link, | 567 | phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link, |
563 | p->phy_interface); | 568 | p->phy_interface); |
564 | } else { | 569 | } else { |