Skip to content

Commit 5115231

Browse files
Danielmachondavem330
authored andcommitted
net: sparx5: ditch sparx5_fdma_rx/tx_reload() functions
These direction specific functions can be ditched in favor of a single function: sparx5_fdma_reload(), which retrieves the channel id from the fdma struct instead. Signed-off-by: Daniel Machon <[email protected]> Reviewed-by: Steen Hegelund <[email protected]> Reviewed-by: Jens Emil Schulz Østergaard <[email protected]> Reviewed-by: Horatiu Vultur <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 55e84c3 commit 5115231

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

drivers/net/ethernet/microchip/sparx5/sparx5_fdma.c

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,10 @@ static void sparx5_fdma_tx_deactivate(struct sparx5 *sparx5, struct sparx5_tx *t
133133
sparx5, FDMA_CH_ACTIVATE);
134134
}
135135

136-
static void sparx5_fdma_rx_reload(struct sparx5 *sparx5, struct sparx5_rx *rx)
136+
static void sparx5_fdma_reload(struct sparx5 *sparx5, struct fdma *fdma)
137137
{
138138
/* Reload the RX channel */
139-
spx5_wr(BIT(rx->fdma.channel_id), sparx5, FDMA_CH_RELOAD);
140-
}
141-
142-
static void sparx5_fdma_tx_reload(struct sparx5 *sparx5, struct sparx5_tx *tx)
143-
{
144-
/* Reload the TX channel */
145-
spx5_wr(BIT(tx->fdma.channel_id), sparx5, FDMA_CH_RELOAD);
139+
spx5_wr(BIT(fdma->channel_id), sparx5, FDMA_CH_RELOAD);
146140
}
147141

148142
static bool sparx5_fdma_rx_get_frame(struct sparx5 *sparx5, struct sparx5_rx *rx)
@@ -213,7 +207,7 @@ static int sparx5_fdma_napi_callback(struct napi_struct *napi, int weight)
213207
sparx5, FDMA_INTR_DB_ENA);
214208
}
215209
if (counter)
216-
sparx5_fdma_rx_reload(sparx5, rx);
210+
sparx5_fdma_reload(sparx5, fdma);
217211
return counter;
218212
}
219213

@@ -246,7 +240,7 @@ int sparx5_fdma_xmit(struct sparx5 *sparx5, u32 *ifh, struct sk_buff *skb)
246240
sparx5_fdma_tx_activate(sparx5, tx);
247241
first_time = false;
248242
} else {
249-
sparx5_fdma_tx_reload(sparx5, tx);
243+
sparx5_fdma_reload(sparx5, fdma);
250244
}
251245
return NETDEV_TX_OK;
252246
}

0 commit comments

Comments
 (0)