Commit 82d5d6a6 authored by Kunihiko Hayashi's avatar Kunihiko Hayashi Committed by David S. Miller

net: ethernet: ave: Avoid lockdep warning

When building with PROVE_LOCKING=y, lockdep shows the following
dump message.

    INFO: trying to register non-static key.
    the code is fine but needs lockdep annotation.
    turning off the locking correctness validator.
     ...

Calling device_set_wakeup_enable() directly occurs this issue,
and it isn't necessary for initialization, so this patch creates
internal function __ave_ethtool_set_wol() and replaces with this
in ave_init() and ave_resume().

Fixes: 7200f2e3 ("net: ethernet: ave: Set initial wol state to disabled")
Signed-off-by: default avatarKunihiko Hayashi <hayashi.kunihiko@socionext.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 36c67349
...@@ -424,16 +424,22 @@ static void ave_ethtool_get_wol(struct net_device *ndev, ...@@ -424,16 +424,22 @@ static void ave_ethtool_get_wol(struct net_device *ndev,
phy_ethtool_get_wol(ndev->phydev, wol); phy_ethtool_get_wol(ndev->phydev, wol);
} }
static int ave_ethtool_set_wol(struct net_device *ndev, static int __ave_ethtool_set_wol(struct net_device *ndev,
struct ethtool_wolinfo *wol) struct ethtool_wolinfo *wol)
{ {
int ret;
if (!ndev->phydev || if (!ndev->phydev ||
(wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE))) (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)))
return -EOPNOTSUPP; return -EOPNOTSUPP;
ret = phy_ethtool_set_wol(ndev->phydev, wol); return phy_ethtool_set_wol(ndev->phydev, wol);
}
static int ave_ethtool_set_wol(struct net_device *ndev,
struct ethtool_wolinfo *wol)
{
int ret;
ret = __ave_ethtool_set_wol(ndev, wol);
if (!ret) if (!ret)
device_set_wakeup_enable(&ndev->dev, !!wol->wolopts); device_set_wakeup_enable(&ndev->dev, !!wol->wolopts);
...@@ -1216,7 +1222,7 @@ static int ave_init(struct net_device *ndev) ...@@ -1216,7 +1222,7 @@ static int ave_init(struct net_device *ndev)
/* set wol initial state disabled */ /* set wol initial state disabled */
wol.wolopts = 0; wol.wolopts = 0;
ave_ethtool_set_wol(ndev, &wol); __ave_ethtool_set_wol(ndev, &wol);
if (!phy_interface_is_rgmii(phydev)) if (!phy_interface_is_rgmii(phydev))
phy_set_max_speed(phydev, SPEED_100); phy_set_max_speed(phydev, SPEED_100);
...@@ -1768,7 +1774,7 @@ static int ave_resume(struct device *dev) ...@@ -1768,7 +1774,7 @@ static int ave_resume(struct device *dev)
ave_ethtool_get_wol(ndev, &wol); ave_ethtool_get_wol(ndev, &wol);
wol.wolopts = priv->wolopts; wol.wolopts = priv->wolopts;
ave_ethtool_set_wol(ndev, &wol); __ave_ethtool_set_wol(ndev, &wol);
if (ndev->phydev) { if (ndev->phydev) {
ret = phy_resume(ndev->phydev); ret = phy_resume(ndev->phydev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment