Skip to content

Commit 515a10a

Browse files
noglitchdavem330
authored andcommitted
net: macb: fix wakeup test in runtime suspend/resume routines
Use the proper struct device pointer to check if the wakeup flag and wakeup source are positioned. Use the one passed by function call which is equivalent to &bp->dev->dev.parent. It's preventing the trigger of a spurious interrupt in case the Wake-on-Lan feature is used. Fixes: d54f89a ("net: macb: Add pm runtime support") Cc: Claudiu Beznea <[email protected]> Cc: Harini Katakam <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Nicolas Ferre <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent c8b1d74 commit 515a10a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4654,7 +4654,7 @@ static int __maybe_unused macb_runtime_suspend(struct device *dev)
46544654
struct net_device *netdev = dev_get_drvdata(dev);
46554655
struct macb *bp = netdev_priv(netdev);
46564656

4657-
if (!(device_may_wakeup(&bp->dev->dev))) {
4657+
if (!(device_may_wakeup(dev))) {
46584658
clk_disable_unprepare(bp->tx_clk);
46594659
clk_disable_unprepare(bp->hclk);
46604660
clk_disable_unprepare(bp->pclk);
@@ -4670,7 +4670,7 @@ static int __maybe_unused macb_runtime_resume(struct device *dev)
46704670
struct net_device *netdev = dev_get_drvdata(dev);
46714671
struct macb *bp = netdev_priv(netdev);
46724672

4673-
if (!(device_may_wakeup(&bp->dev->dev))) {
4673+
if (!(device_may_wakeup(dev))) {
46744674
clk_prepare_enable(bp->pclk);
46754675
clk_prepare_enable(bp->hclk);
46764676
clk_prepare_enable(bp->tx_clk);

0 commit comments

Comments
 (0)