Skip to content

Commit

Permalink
net: dsa: Do not override PHY interface if already configured
Browse files Browse the repository at this point in the history
In case we need to divert reads/writes using the slave MII bus, we may have
already fetched a valid PHY interface property from Device Tree, and that
mode is used by the PHY driver to make configuration decisions.

If we could not fetch the "phy-mode" property, we will assign p->phy_interface
to PHY_INTERFACE_MODE_NA, such that we can actually check for that condition as
to whether or not we should override the interface value.

Fixes: 1933492 ("net: dsa: Set valid phy interface type")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Aug 12, 2015
1 parent 28eaad7 commit 211c504
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/dsa/slave.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,8 @@ static int dsa_slave_phy_connect(struct dsa_slave_priv *p,
return -ENODEV;

/* Use already configured phy mode */
p->phy_interface = p->phy->interface;
if (p->phy_interface == PHY_INTERFACE_MODE_NA)
p->phy_interface = p->phy->interface;
phy_connect_direct(slave_dev, p->phy, dsa_slave_adjust_link,
p->phy_interface);

Expand Down

0 comments on commit 211c504

Please sign in to comment.