From: <Woojung.Huh@microchip.com>
Date: Thu, 10 Sep 2015 22:16:11 +0000
quoted hunk ↗ jump to hunk
@@ -1287,42 +1074,30 @@ static int lan78xx_set_wol(struct net_device *netdev,
static int lan78xx_get_eee(struct net_device *net, struct ethtool_eee *edata)
{
struct lan78xx_net *dev = netdev_priv(net);
+ struct phy_device *phydev = net->phydev;
int ret;
u32 buf;
- u32 adv, lpadv;
ret = usb_autopm_get_interface(dev->intf);
if (ret < 0)
return ret;
+ ret = phy_ethtool_get_eee(phydev, edata);
+ if (ret)
+ return ret;
+
You cannot return directly if phy_ethtool_get_eee() returns an error,
you must branch to the end of this function and properly perform
the usb_autopm_get_interface().