diff options
author | Cristian Sovaiala <cristian.sovaiala@freescale.com> | 2014-05-13 15:28:32 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2014-05-14 13:58:04 (GMT) |
commit | 93488879cf12aabd7e0a8c4f3bfb02ecf484d246 (patch) | |
tree | 8ddf74e1fa8f66769e9b88a70607e617f54a1c26 /drivers/net/ethernet/freescale/dpa | |
parent | 816177d3cbd08ddc7c23ce51650346f5b263c386 (diff) | |
download | linux-fsl-qoriq-93488879cf12aabd7e0a8c4f3bfb02ecf484d246.tar.xz |
dpaa_eth: Reordering of FMD API calls in suspend/resume callbacks
Reordered the fm_port_suspend/resume, set_wol API calls.
Besides that, in resume callback we do not suspend the port anymore
in case of error such as when the setting of MG bit fails.
The goto labels have been updated accordingly.
Change-Id: I1e8cbe29be4f30129162f0c152bd2914615b7b98
Signed-off-by: Cristian Sovaiala <cristian.sovaiala@freescale.com>
Reviewed-on: http://git.am.freescale.net:8181/12326
Reviewed-by: Madalin-Cristian Bucur <madalin.bucur@freescale.com>
Reviewed-by: Ruxandra Ioana Radulescu <ruxandra.radulescu@freescale.com>
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Reviewed-by: Marian Cristian Rotariu <marian.rotariu@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale/dpa')
-rw-r--r-- | drivers/net/ethernet/freescale/dpa/dpaa_eth.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c index 3231725..e6f50a5 100644 --- a/drivers/net/ethernet/freescale/dpa/dpaa_eth.c +++ b/drivers/net/ethernet/freescale/dpa/dpaa_eth.c @@ -123,6 +123,15 @@ static int dpaa_suspend_noirq(struct device *dev) priv = netdev_priv(net_dev); mac_dev = priv->mac_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), true); + if (err) { + netdev_err(net_dev, "set_wol() = %d\n", err); + goto set_wol_failed; + } + } + err = fm_port_suspend(mac_dev->port_dev[RX]); if (err) { netdev_err(net_dev, "fm_port_suspend(RX) = %d\n", err); @@ -134,24 +143,18 @@ static int dpaa_suspend_noirq(struct device *dev) 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 (err) { - netdev_err(net_dev, "set_wol() = %d\n", err); - goto set_wol_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: + if (priv->wol & DPAA_WOL_MAGIC) { + priv->mac_dev->set_wol(mac_dev->port_dev[RX], + priv->mac_dev->get_mac_handle(mac_dev), false); + } +set_wol_failed: return err; } @@ -168,34 +171,31 @@ static int dpaa_resume_noirq(struct device *dev) priv = netdev_priv(net_dev); mac_dev = priv->mac_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 (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) { netdev_err(net_dev, "fm_port_resume(TX) = %d\n", err); - goto tx_port_resume_failed; + goto resume_failed; } err = fm_port_resume(mac_dev->port_dev[RX]); if (err) { netdev_err(net_dev, "fm_port_resume(RX) = %d\n", err); - goto rx_port_resume_failed; + goto resume_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), false); + if (err) { + netdev_err(net_dev, "set_wol() = %d\n", err); + goto resume_failed; + } } } return 0; -rx_port_resume_failed: - fm_port_suspend(mac_dev->port_dev[TX]); -tx_port_resume_failed: -set_wol_failed: +resume_failed: return err; } |