Skip to content

Commit ced4799

Browse files
noglitchdavem330
authored andcommitted
net: macb: mark device wake capable when "magic-packet" property present
Change the way the "magic-packet" DT property is handled in the macb_probe() function, matching DT binding documentation. Now we mark the device as "wakeup capable" instead of calling the device_init_wakeup() function that would enable the wakeup source. For Ethernet WoL, enabling the wakeup_source is done by using ethtool and associated macb_set_wol() function that already calls device_set_wakeup_enable() for this purpose. That would reduce power consumption by cutting more clocks if "magic-packet" property is set but WoL is not configured by ethtool. Fixes: 3e2a5e1 ("net: macb: add wake-on-lan support via magic packet") Cc: Claudiu Beznea <[email protected]> Cc: Harini Katakam <[email protected]> Cc: Sergio Prado <[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 515a10a commit ced4799

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4422,7 +4422,7 @@ static int macb_probe(struct platform_device *pdev)
44224422
bp->wol = 0;
44234423
if (of_get_property(np, "magic-packet", NULL))
44244424
bp->wol |= MACB_WOL_HAS_MAGIC_PACKET;
4425-
device_init_wakeup(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
4425+
device_set_wakeup_capable(&pdev->dev, bp->wol & MACB_WOL_HAS_MAGIC_PACKET);
44264426

44274427
spin_lock_init(&bp->lock);
44284428

0 commit comments

Comments
 (0)