Commit 02cacede authored by Ivan Khoronzhuk's avatar Ivan Khoronzhuk Committed by David S. Miller

net: ethernet: ti: cpsw: correct .ndo_open error path

It's found while review and probably never happens, but real number
of queues is set per device, and error path should be per device.
So split error path based on usage_count.
Signed-off-by: default avatarIvan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6faaffb3
...@@ -1423,8 +1423,11 @@ static int cpsw_ndo_open(struct net_device *ndev) ...@@ -1423,8 +1423,11 @@ static int cpsw_ndo_open(struct net_device *ndev)
return 0; return 0;
err_cleanup: err_cleanup:
cpdma_ctlr_stop(cpsw->dma); if (!cpsw->usage_count) {
for_each_slave(priv, cpsw_slave_stop, cpsw); cpdma_ctlr_stop(cpsw->dma);
for_each_slave(priv, cpsw_slave_stop, cpsw);
}
pm_runtime_put_sync(cpsw->dev); pm_runtime_put_sync(cpsw->dev);
netif_carrier_off(priv->ndev); netif_carrier_off(priv->ndev);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment