net: phy: xgmiitorgmii: Check read_status results

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>
This commit is contained in:
Brandon Maier 2018-06-26 12:50:50 -05:00 коммит произвёл David S. Miller
Родитель cf31ea71c0
Коммит 8d0752d113
1 изменённых файлов: 4 добавлений и 1 удалений

Просмотреть файл

@ -42,8 +42,11 @@ static int xgmiitorgmii_read_status(struct phy_device *phydev)
struct mii_bus *bus = priv->mdio->bus; struct mii_bus *bus = priv->mdio->bus;
int addr = priv->mdio->addr; int addr = priv->mdio->addr;
u16 val = 0; 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 = mdiobus_read(bus, addr, XILINX_GMII2RGMII_REG);
val &= ~XILINX_GMII2RGMII_SPEED_MASK; val &= ~XILINX_GMII2RGMII_SPEED_MASK;