net: dsa: Set valid phy interface type
authorGuenter Roeck <[email protected]>
Tue, 17 Feb 2015 05:23:51 +0000 (21:23 -0800)
committerDavid S. Miller <[email protected]>
Tue, 17 Feb 2015 18:37:39 +0000 (10:37 -0800)
commit19334920eaf7df3f69950b040ede6c7598425a5b
tree42c0b8a3df8bb7393c7e467f73feed8d6f7e722b
parent7afb8886a05be68e376655539a064ec672de8a8e
net: dsa: Set valid phy interface type

If the phy interface mode is not found in devicetree, or if devicetree
is not configured, of_get_phy_mode returns -ENODEV. The current code
sets the phy interface mode to the return value from of_get_phy_mode
without checking if it is valid.

This invalid phy interface mode is passed as parameter to of_phy_connect
or to phy_connect_direct. This sets the phy interface mode to the invalid
value, which in turn causes problems for any code using phydev->interface.

Fixes: b31f65fb4383 ("net: dsa: slave: Fix autoneg for phys on switch MDIO bus")
Fixes: 0d8bcdd383b8 ("net: dsa: allow for more complex PHY setups")
Cc: Florian Fainelli <[email protected]>
Cc: Andrew Lunn <[email protected]>
Signed-off-by: Guenter Roeck <[email protected]>
Acked-by: Florian Fainelli <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/dsa/slave.c