Commit f6dda809 authored by Ioana Radulescu's avatar Ioana Radulescu Committed by Greg Kroah-Hartman

staging: fsl-dpaa2/eth: Label cleanup

Clean up goto labels in a couple of functions, by
removing/renaming redundant ones.
Signed-off-by: default avatarIoana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: default avatarBogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7cd310f3
...@@ -1444,34 +1444,32 @@ static struct fsl_mc_device *setup_dpcon(struct dpaa2_eth_priv *priv) ...@@ -1444,34 +1444,32 @@ static struct fsl_mc_device *setup_dpcon(struct dpaa2_eth_priv *priv)
err = dpcon_open(priv->mc_io, 0, dpcon->obj_desc.id, &dpcon->mc_handle); err = dpcon_open(priv->mc_io, 0, dpcon->obj_desc.id, &dpcon->mc_handle);
if (err) { if (err) {
dev_err(dev, "dpcon_open() failed\n"); dev_err(dev, "dpcon_open() failed\n");
goto err_open; goto free;
} }
err = dpcon_reset(priv->mc_io, 0, dpcon->mc_handle); err = dpcon_reset(priv->mc_io, 0, dpcon->mc_handle);
if (err) { if (err) {
dev_err(dev, "dpcon_reset() failed\n"); dev_err(dev, "dpcon_reset() failed\n");
goto err_reset; goto close;
} }
err = dpcon_get_attributes(priv->mc_io, 0, dpcon->mc_handle, &attrs); err = dpcon_get_attributes(priv->mc_io, 0, dpcon->mc_handle, &attrs);
if (err) { if (err) {
dev_err(dev, "dpcon_get_attributes() failed\n"); dev_err(dev, "dpcon_get_attributes() failed\n");
goto err_get_attr; goto close;
} }
err = dpcon_enable(priv->mc_io, 0, dpcon->mc_handle); err = dpcon_enable(priv->mc_io, 0, dpcon->mc_handle);
if (err) { if (err) {
dev_err(dev, "dpcon_enable() failed\n"); dev_err(dev, "dpcon_enable() failed\n");
goto err_enable; goto close;
} }
return dpcon; return dpcon;
err_enable: close:
err_get_attr:
err_reset:
dpcon_close(priv->mc_io, 0, dpcon->mc_handle); dpcon_close(priv->mc_io, 0, dpcon->mc_handle);
err_open: free:
fsl_mc_object_free(dpcon); fsl_mc_object_free(dpcon);
return NULL; return NULL;
...@@ -1794,7 +1792,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) ...@@ -1794,7 +1792,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
err = dpni_open(priv->mc_io, 0, ls_dev->obj_desc.id, &priv->mc_token); err = dpni_open(priv->mc_io, 0, ls_dev->obj_desc.id, &priv->mc_token);
if (err) { if (err) {
dev_err(dev, "dpni_open() failed\n"); dev_err(dev, "dpni_open() failed\n");
goto err_open; return err;
} }
ls_dev->mc_io = priv->mc_io; ls_dev->mc_io = priv->mc_io;
...@@ -1803,14 +1801,14 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) ...@@ -1803,14 +1801,14 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
err = dpni_reset(priv->mc_io, 0, priv->mc_token); err = dpni_reset(priv->mc_io, 0, priv->mc_token);
if (err) { if (err) {
dev_err(dev, "dpni_reset() failed\n"); dev_err(dev, "dpni_reset() failed\n");
goto err_reset; goto close;
} }
err = dpni_get_attributes(priv->mc_io, 0, priv->mc_token, err = dpni_get_attributes(priv->mc_io, 0, priv->mc_token,
&priv->dpni_attrs); &priv->dpni_attrs);
if (err) { if (err) {
dev_err(dev, "dpni_get_attributes() failed (err=%d)\n", err); dev_err(dev, "dpni_get_attributes() failed (err=%d)\n", err);
goto err_get_attr; goto close;
} }
/* Configure buffer layouts */ /* Configure buffer layouts */
...@@ -1827,7 +1825,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) ...@@ -1827,7 +1825,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
DPNI_QUEUE_RX, &buf_layout); DPNI_QUEUE_RX, &buf_layout);
if (err) { if (err) {
dev_err(dev, "dpni_set_buffer_layout(RX) failed\n"); dev_err(dev, "dpni_set_buffer_layout(RX) failed\n");
goto err_buf_layout; goto close;
} }
/* tx buffer */ /* tx buffer */
...@@ -1837,7 +1835,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) ...@@ -1837,7 +1835,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
DPNI_QUEUE_TX, &buf_layout); DPNI_QUEUE_TX, &buf_layout);
if (err) { if (err) {
dev_err(dev, "dpni_set_buffer_layout(TX) failed\n"); dev_err(dev, "dpni_set_buffer_layout(TX) failed\n");
goto err_buf_layout; goto close;
} }
/* tx-confirm buffer */ /* tx-confirm buffer */
...@@ -1846,7 +1844,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) ...@@ -1846,7 +1844,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
DPNI_QUEUE_TX_CONFIRM, &buf_layout); DPNI_QUEUE_TX_CONFIRM, &buf_layout);
if (err) { if (err) {
dev_err(dev, "dpni_set_buffer_layout(TX_CONF) failed\n"); dev_err(dev, "dpni_set_buffer_layout(TX_CONF) failed\n");
goto err_buf_layout; goto close;
} }
/* Now that we've set our tx buffer layout, retrieve the minimum /* Now that we've set our tx buffer layout, retrieve the minimum
...@@ -1856,7 +1854,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) ...@@ -1856,7 +1854,7 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
&priv->tx_data_offset); &priv->tx_data_offset);
if (err) { if (err) {
dev_err(dev, "dpni_get_tx_data_offset() failed\n"); dev_err(dev, "dpni_get_tx_data_offset() failed\n");
goto err_data_offset; goto close;
} }
if ((priv->tx_data_offset % 64) != 0) if ((priv->tx_data_offset % 64) != 0)
...@@ -1868,12 +1866,9 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) ...@@ -1868,12 +1866,9 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
return 0; return 0;
err_data_offset: close:
err_buf_layout:
err_get_attr:
err_reset:
dpni_close(priv->mc_io, 0, priv->mc_token); dpni_close(priv->mc_io, 0, priv->mc_token);
err_open:
return err; return err;
} }
......
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