Skip to content

Commit

Permalink
net: phy: xgmiitorgmii: Check read_status results
Browse files Browse the repository at this point in the history
We're ignoring the result of the attached phy device's read_status().
Return it so we can detect errors.

Signed-off-by: Brandon Maier <brandon.maier@rockwellcollins.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Brandon Maier authored and David S. Miller committed Jun 28, 2018
1 parent cf31ea7 commit 8d0752d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/net/phy/xilinx_gmii2rgmii.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ static int xgmiitorgmii_read_status(struct phy_device *phydev)
struct mii_bus *bus = priv->mdio->bus;
int addr = priv->mdio->addr;
u16 val = 0;
int err;

priv->phy_drv->read_status(phydev);
err = priv->phy_drv->read_status(phydev);
if (err < 0)
return err;

val = mdiobus_read(bus, addr, XILINX_GMII2RGMII_REG);
val &= ~XILINX_GMII2RGMII_SPEED_MASK;
Expand Down

0 comments on commit 8d0752d

Please sign in to comment.