diff options
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth.c | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index 862357a..3231725 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -124,22 +124,34 @@ static int dpaa_suspend_noirq(struct device *dev) mac_dev = priv->mac_dev; err = fm_port_suspend(mac_dev->port_dev[RX]); - if (err) - goto port_suspend_failed; + if (err) { + netdev_err(net_dev, "fm_port_suspend(RX) = %d\n", err); + goto rx_port_suspend_failed; + } err = fm_port_suspend(mac_dev->port_dev[TX]); - if (err) - err = fm_port_resume(mac_dev->port_dev[RX]); + if (err) { + netdev_err(net_dev, "fm_port_suspend(TX) = %d\n", err); + goto tx_port_suspend_failed; + } if (priv->wol & DPAA_WOL_MAGIC) { err = priv->mac_dev->set_wol(mac_dev->port_dev[RX], priv->mac_dev->get_mac_handle(mac_dev), true); - if (unlikely(err < 0)) + if (err) { netdev_err(net_dev, "set_wol() = %d\n", err); + goto set_wol_failed; + } } } -port_suspend_failed: + return 0; + +set_wol_failed: + fm_port_resume(mac_dev->port_dev[TX]); +tx_port_suspend_failed: + fm_port_resume(mac_dev->port_dev[RX]); +rx_port_suspend_failed: return err; } @@ -159,20 +171,31 @@ static int dpaa_resume_noirq(struct device *dev) if (priv->wol & DPAA_WOL_MAGIC) { err = priv->mac_dev->set_wol(mac_dev->port_dev[RX], priv->mac_dev->get_mac_handle(mac_dev), false); - if (unlikely(err < 0)) + if (err) { netdev_err(net_dev, "set_wol() = %d\n", err); + goto set_wol_failed; + } } err = fm_port_resume(mac_dev->port_dev[TX]); - if (err) - goto port_resume_failed; + if (err) { + netdev_err(net_dev, "fm_port_resume(TX) = %d\n", err); + goto tx_port_resume_failed; + } err = fm_port_resume(mac_dev->port_dev[RX]); - if (err) - err = fm_port_suspend(mac_dev->port_dev[TX]); + if (err) { + netdev_err(net_dev, "fm_port_resume(RX) = %d\n", err); + goto rx_port_resume_failed; + } } -port_resume_failed: + return 0; + +rx_port_resume_failed: + fm_port_suspend(mac_dev->port_dev[TX]); +tx_port_resume_failed: +set_wol_failed: return err; } |