/* Description: Reads the status register and returns 0 either if auto-negotiation is incomplete, or if there was an error. Returns BMSR_ANEGCOMPLETE if auto-negotiation is done.  */
static int phy_aneg_done(struct phy_device *phydev)
/* Description: Reads the status register and returns 0 either if auto-negotiation is incomplete, or if there was an error. Returns BMSR_ANEGCOMPLETE if auto-negotiation is done.  */
static int phy_aneg_done(struct phy_device *phydev)
{
	int retval;
	retval = phy_read(phydev, MII_BMSR);
	return (retval < 0) ? retval : (retval & BMSR_ANEGCOMPLETE);
}