Skip to content

Commit 82d5d6a

Browse files
khayash1davem330
authored andcommitted
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: 7200f2e ("net: ethernet: ave: Set initial wol state to disabled") Signed-off-by: Kunihiko Hayashi <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 36c6734 commit 82d5d6a

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

drivers/net/ethernet/socionext/sni_ave.c

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -424,16 +424,22 @@ static void ave_ethtool_get_wol(struct net_device *ndev,
424424
phy_ethtool_get_wol(ndev->phydev, wol);
425425
}
426426

427-
static int ave_ethtool_set_wol(struct net_device *ndev,
428-
struct ethtool_wolinfo *wol)
427+
static int __ave_ethtool_set_wol(struct net_device *ndev,
428+
struct ethtool_wolinfo *wol)
429429
{
430-
int ret;
431-
432430
if (!ndev->phydev ||
433431
(wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)))
434432
return -EOPNOTSUPP;
435433

436-
ret = phy_ethtool_set_wol(ndev->phydev, wol);
434+
return phy_ethtool_set_wol(ndev->phydev, wol);
435+
}
436+
437+
static int ave_ethtool_set_wol(struct net_device *ndev,
438+
struct ethtool_wolinfo *wol)
439+
{
440+
int ret;
441+
442+
ret = __ave_ethtool_set_wol(ndev, wol);
437443
if (!ret)
438444
device_set_wakeup_enable(&ndev->dev, !!wol->wolopts);
439445

@@ -1216,7 +1222,7 @@ static int ave_init(struct net_device *ndev)
12161222

12171223
/* set wol initial state disabled */
12181224
wol.wolopts = 0;
1219-
ave_ethtool_set_wol(ndev, &wol);
1225+
__ave_ethtool_set_wol(ndev, &wol);
12201226

12211227
if (!phy_interface_is_rgmii(phydev))
12221228
phy_set_max_speed(phydev, SPEED_100);
@@ -1768,7 +1774,7 @@ static int ave_resume(struct device *dev)
17681774

17691775
ave_ethtool_get_wol(ndev, &wol);
17701776
wol.wolopts = priv->wolopts;
1771-
ave_ethtool_set_wol(ndev, &wol);
1777+
__ave_ethtool_set_wol(ndev, &wol);
17721778

17731779
if (ndev->phydev) {
17741780
ret = phy_resume(ndev->phydev);

0 commit comments

Comments
 (0)