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

staging: fsl-dpaa2/eth: Remove unused fields from priv struct

Remove the dpni_id and buffer_layout fields from device's
private structure. They're only used at probe so we don't
need to store them for further use.
Signed-off-by: default avatarIoana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d695e764
...@@ -1734,15 +1734,14 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) ...@@ -1734,15 +1734,14 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
struct device *dev = &ls_dev->dev; struct device *dev = &ls_dev->dev;
struct dpaa2_eth_priv *priv; struct dpaa2_eth_priv *priv;
struct net_device *net_dev; struct net_device *net_dev;
struct dpni_buffer_layout buf_layout = {0};
int err; int err;
net_dev = dev_get_drvdata(dev); net_dev = dev_get_drvdata(dev);
priv = netdev_priv(net_dev); priv = netdev_priv(net_dev);
priv->dpni_id = ls_dev->obj_desc.id;
/* get a handle for the DPNI object */ /* get a handle for the DPNI object */
err = dpni_open(priv->mc_io, 0, priv->dpni_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; goto err_open;
...@@ -1766,35 +1765,35 @@ static int setup_dpni(struct fsl_mc_device *ls_dev) ...@@ -1766,35 +1765,35 @@ static int setup_dpni(struct fsl_mc_device *ls_dev)
/* Configure buffer layouts */ /* Configure buffer layouts */
/* rx buffer */ /* rx buffer */
priv->buf_layout.pass_parser_result = true; buf_layout.pass_parser_result = true;
priv->buf_layout.pass_frame_status = true; buf_layout.pass_frame_status = true;
priv->buf_layout.private_data_size = DPAA2_ETH_SWA_SIZE; buf_layout.private_data_size = DPAA2_ETH_SWA_SIZE;
priv->buf_layout.data_align = DPAA2_ETH_RX_BUF_ALIGN; buf_layout.data_align = DPAA2_ETH_RX_BUF_ALIGN;
priv->buf_layout.options = DPNI_BUF_LAYOUT_OPT_PARSER_RESULT | buf_layout.options = DPNI_BUF_LAYOUT_OPT_PARSER_RESULT |
DPNI_BUF_LAYOUT_OPT_FRAME_STATUS | DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE | DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE |
DPNI_BUF_LAYOUT_OPT_DATA_ALIGN; DPNI_BUF_LAYOUT_OPT_DATA_ALIGN;
err = dpni_set_buffer_layout(priv->mc_io, 0, priv->mc_token, err = dpni_set_buffer_layout(priv->mc_io, 0, priv->mc_token,
DPNI_QUEUE_RX, &priv->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 err_buf_layout;
} }
/* tx buffer */ /* tx buffer */
priv->buf_layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS | buf_layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS |
DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE; DPNI_BUF_LAYOUT_OPT_PRIVATE_DATA_SIZE;
err = dpni_set_buffer_layout(priv->mc_io, 0, priv->mc_token, err = dpni_set_buffer_layout(priv->mc_io, 0, priv->mc_token,
DPNI_QUEUE_TX, &priv->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 err_buf_layout;
} }
/* tx-confirm buffer */ /* tx-confirm buffer */
priv->buf_layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS; buf_layout.options = DPNI_BUF_LAYOUT_OPT_FRAME_STATUS;
err = dpni_set_buffer_layout(priv->mc_io, 0, priv->mc_token, err = dpni_set_buffer_layout(priv->mc_io, 0, priv->mc_token,
DPNI_QUEUE_TX_CONFIRM, &priv->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 err_buf_layout;
......
...@@ -297,12 +297,7 @@ struct dpaa2_eth_priv { ...@@ -297,12 +297,7 @@ struct dpaa2_eth_priv {
u8 num_channels; u8 num_channels;
struct dpaa2_eth_channel *channel[DPAA2_ETH_MAX_DPCONS]; struct dpaa2_eth_channel *channel[DPAA2_ETH_MAX_DPCONS];
int dpni_id;
struct dpni_attr dpni_attrs; struct dpni_attr dpni_attrs;
/* Insofar as the MC is concerned, we're using one layout on all 3 types
* of buffers (Rx, Tx, Tx-Conf).
*/
struct dpni_buffer_layout buf_layout;
u16 tx_data_offset; u16 tx_data_offset;
struct fsl_mc_device *dpbp_dev; struct fsl_mc_device *dpbp_dev;
......
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