]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: Set valid phy interface type
authorGuenter Roeck <linux@roeck-us.net>
Tue, 17 Feb 2015 05:23:51 +0000 (21:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Feb 2015 18:37:39 +0000 (10:37 -0800)
commit465900c5c8de9b34e59256645e29381b431ff1f3
tree42c0b8a3df8bb7393c7e467f73feed8d6f7e722b
parent86ea007c92b6ba401e2591c0418daf084c5a70a0
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: 9320fd1f013d ("net: dsa: slave: Fix autoneg for phys on switch MDIO bus")
Fixes: d2ef8618baf2 ("net: dsa: allow for more complex PHY setups")
Cc: Florian Fainelli <f.fainelli@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c