Commit 4e2905ad authored by Dan Murphy's avatar Dan Murphy Committed by David S. Miller

net: dp83869: Reset return variable if PHY strap is read

When the PHY's strap register is read to determine if lane swapping is
needed the phy_read_mmd returns the value back into the ret variable.

If the call to read the strap fails the failed value is returned.  If
the call to read the strap is successful then ret is possibly set to a
non-zero positive number. Without reseting the ret value to 0 this will
cause the parse DT function to return a failure.

Fixes: c4566aec ("net: phy: dp83869: Update port-mirroring to read straps")
Signed-off-by: default avatarDan Murphy <dmurphy@ti.com>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4a3084aa
...@@ -218,10 +218,13 @@ static int dp83869_of_init(struct phy_device *phydev) ...@@ -218,10 +218,13 @@ static int dp83869_of_init(struct phy_device *phydev)
ret = phy_read_mmd(phydev, DP83869_DEVADDR, DP83869_STRAP_STS1); ret = phy_read_mmd(phydev, DP83869_DEVADDR, DP83869_STRAP_STS1);
if (ret < 0) if (ret < 0)
return ret; return ret;
if (ret & DP83869_STRAP_MIRROR_ENABLED) if (ret & DP83869_STRAP_MIRROR_ENABLED)
dp83869->port_mirroring = DP83869_PORT_MIRRORING_EN; dp83869->port_mirroring = DP83869_PORT_MIRRORING_EN;
else else
dp83869->port_mirroring = DP83869_PORT_MIRRORING_DIS; dp83869->port_mirroring = DP83869_PORT_MIRRORING_DIS;
ret = 0;
} }
if (of_property_read_u32(of_node, "rx-fifo-depth", if (of_property_read_u32(of_node, "rx-fifo-depth",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment