gianfar: Enable device wakeup when appropriate
The wol_en flag is 0 by default anyway, and we have the following inconsistency: a MAGIC packet wol capable eth interface is registered as a wake-up source but unable to wake-up the system as wol_en is 0 (wake-on flag set to 'd'). Calling set_wakeup_enable() at netdev open is just redundant because wol_en is 0 by default. Let only ethtool call set_wakeup_enable() for now. The bflock is obviously obsoleted, its utility has been corroded over time. The bitfield flags used today in gianfar are accessed only on the init/ config path, with no real possibility of concurrency - nothing that would justify smth. like bflock. Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
614b42426c
commit
b0734b6dc8
@@ -1360,7 +1360,6 @@ static int gfar_probe(struct platform_device *ofdev)
|
||||
priv->dev = &ofdev->dev;
|
||||
SET_NETDEV_DEV(dev, &ofdev->dev);
|
||||
|
||||
spin_lock_init(&priv->bflock);
|
||||
INIT_WORK(&priv->reset_task, gfar_reset_task);
|
||||
|
||||
platform_set_drvdata(ofdev, priv);
|
||||
@@ -1454,9 +1453,8 @@ static int gfar_probe(struct platform_device *ofdev)
|
||||
goto register_fail;
|
||||
}
|
||||
|
||||
device_init_wakeup(&dev->dev,
|
||||
priv->device_flags &
|
||||
FSL_GIANFAR_DEV_HAS_MAGIC_PACKET);
|
||||
device_set_wakeup_capable(&dev->dev, priv->device_flags &
|
||||
FSL_GIANFAR_DEV_HAS_MAGIC_PACKET);
|
||||
|
||||
/* fill out IRQ number and name fields */
|
||||
for (i = 0; i < priv->num_grps; i++) {
|
||||
@@ -2133,8 +2131,6 @@ static int gfar_enet_open(struct net_device *dev)
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
device_set_wakeup_enable(&dev->dev, priv->wol_en);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user