Re: [PATCH 1/2] net: phy: Add error checks in the driver

From: Andrew Lunn
Date: Fri Aug 19 2016 - 09:15:28 EST


> - mdiobus_write(phydev->mdio.bus, priv->addr, XILINX_GMII2RGMII_REG, val);
> + err = mdiobus_write(phydev->mdio.bus, priv->addr, XILINX_GMII2RGMII_REG,
> + val);
> + if (err < 0)
> + return err;
>
> return 0;

Do you need to assign err? Why not just

return mdiobus_write(phydev->mdio.bus, priv->addr, XILINX_GMII2RGMII_REG,
val);