mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
net: dsa: Do not suspend/resume closed slave_dev
[ Upstream commita94c689e6c] If a DSA slave network device was previously disabled, there is no need to suspend or resume it. Fixes:2446254915("net: dsa: allow switch drivers to implement suspend/resume hooks") Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
8721f36089
commit
bcbdea1371
@@ -1219,6 +1219,9 @@ int dsa_slave_suspend(struct net_device *slave_dev)
|
||||
{
|
||||
struct dsa_slave_priv *p = netdev_priv(slave_dev);
|
||||
|
||||
if (!netif_running(slave_dev))
|
||||
return 0;
|
||||
|
||||
netif_device_detach(slave_dev);
|
||||
|
||||
if (p->phy) {
|
||||
@@ -1236,6 +1239,9 @@ int dsa_slave_resume(struct net_device *slave_dev)
|
||||
{
|
||||
struct dsa_slave_priv *p = netdev_priv(slave_dev);
|
||||
|
||||
if (!netif_running(slave_dev))
|
||||
return 0;
|
||||
|
||||
netif_device_attach(slave_dev);
|
||||
|
||||
if (p->phy) {
|
||||
|
||||
Reference in New Issue
Block a user