lkml.org 
[lkml]   [2014]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: phy: fix uninitalized WOL parameters in phy_ethtool_get_wol
From
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Date: Mon, 10 Mar 2014 10:49:53 +0000

> void phy_ethtool_get_wol(struct phy_device *phydev, struct
> ethtool_wolinfo *wol)
> {
> memset(wol, 0, sizeof(*wol));
>
> if (phydev && phydev->drv->get_wol)
> phydev->drv->get_wol(phydev, wol);
> }
>
> That would also simplify above drivers down to e.g:
>
> static void cpsw_get_wol(struct net_device *ndev, struct
> ethtool_wolinfo *wol)
> {
> struct cpsw_priv *priv = netdev_priv(ndev);
> int slave_no = cpsw_slave_index(priv);
> phy_ethtool_get_wol(priv->slaves[slave_no].phy, wol);
> }
>
> instead of:
>
> static void cpsw_get_wol(struct net_device *ndev, struct
> ethtool_wolinfo *wol)
> {
> struct cpsw_priv *priv = netdev_priv(ndev);
> int slave_no = cpsw_slave_index(priv);
>
> wol->supported = 0;
> wol->wolopts = 0;
>
> if (priv->slaves[slave_no].phy)
> phy_ethtool_get_wol(priv->slaves[slave_no].phy, wol);
> }

Agreed, since phy_ethtool_get_wol() is the common routine used by the drivers,
we should make it clear the structure.


\
 
 \ /
  Last update: 2014-03-10 22:01    [W:0.094 / U:0.292 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site