diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index c1d6ebf12ec7..523436690ade 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -2645,8 +2645,8 @@ EXPORT_SYMBOL(genphy_resume); int genphy_loopback(struct phy_device *phydev, bool enable) { if (enable) { - u16 val, ctl = BMCR_LOOPBACK; - int ret; + u16 ctl = BMCR_LOOPBACK; + int ret, val; if (phydev->speed == SPEED_1000) ctl |= BMCR_SPEED1000;