Hi, Andrew On 2017/6/23 11:16, Andrew Lunn wrote: >> +int genphy_loopback(struct phy_device *phydev, bool enable) >> +{ >> + int value; >> + >> + if (enable) { >> + value = phy_read(phydev, MII_BMCR); >> + phy_write(phydev, MII_BMCR, value | BMCR_LOOPBACK); >> + } else { >> + value = phy_read(phydev, MII_BMCR); >> + phy_write(phydev, MII_BMCR, value & ~BMCR_LOOPBACK); >> + } > > You should add error checking here. Both phy_read and phy_write can > return an error. Also, do the read and write once. Thanks for pointing out, will do that next vesion.
> >> + >> + return 0; >> +} >> +EXPORT_SYMBOL(genphy_loopback); >> + >> +static int gen10g_loopback(struct phy_device *phydev, bool enable) >> +{ >> + return 0; >> +} > > This is pointless. The core code in phy.c should first check if the > function exists before calling it. So not having a 10g method is fine. > will remove it next vesion. Best Regards Yunsheng Lin