From: Varka Bhadram
On 07/14/2014 02:32 PM, Jongsung Kim wrote:...
This patch enables the ethtool utility to control the WOL function
of the PHY connected to the GEM/MACB. (if supported)
I would do:+static int macb_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)I think we can do in this way:
+{
+ struct macb *bp = netdev_priv(netdev);
+ struct phy_device *phydev = bp->phy_dev;
+ int err = -ENODEV;
+
+ if (phydev)
+ err = phy_ethtool_set_wol(phydev, wol);
+
+ return err;
+}
+
if (phydev)
return phy_ethtool_set_wol(phydev, wol);
else
return -ENODEV;
we can save err. What do you say ...?
if (!phydev)
return -ENODEV;
return phy_ethtool_set_wol(phydev, wol);