]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: dsa: Do not override PHY interface if already configured
authorFlorian Fainelli <f.fainelli@gmail.com>
Sat, 8 Aug 2015 19:58:57 +0000 (12:58 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Sep 2015 17:26:26 +0000 (19:26 +0200)
commitb21ee342590aa41e21aa0196bff5af592cc349d0
tree072370f134d4e06651f4d76ba7cd0e4b5b8cbfa2
parent0c1122ae6107b01e50bb18fa40eb44e7fa492fbc
net: dsa: Do not override PHY interface if already configured

[ Upstream commit 211c504a444710b1d8ce3431ac19f2578602ca27 ]

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: 19334920eaf7 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/dsa/slave.c