diff mbox series

[v2,44/50] wilc1000: don't allocate tx_buffer when zero-copy is available

Message ID 20211223011358.4031459-45-davidm@egauge.net (mailing list archive)
State Changes Requested
Delegated to: Kalle Valo
Headers show
Series wilc1000: rework tx path to use sk_buffs throughout | expand

Commit Message

David Mosberger-Tang Dec. 23, 2021, 1:14 a.m. UTC
If a driver supports zero-copy transmit transfers, there is no need to
have a transmit buffer.

Signed-off-by: David Mosberger-Tang <davidm@egauge.net>
---
 drivers/net/wireless/microchip/wilc1000/wlan.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/microchip/wilc1000/wlan.c b/drivers/net/wireless/microchip/wilc1000/wlan.c
index d96a7e2a0bd59..d46d6e8122c8d 100644
--- a/drivers/net/wireless/microchip/wilc1000/wlan.c
+++ b/drivers/net/wireless/microchip/wilc1000/wlan.c
@@ -1604,12 +1604,12 @@  int wilc_wlan_init(struct net_device *dev)
 
 	init_q_limits(wilc);
 
-	if (!wilc->tx_buffer)
+	if (!wilc->hif_func->hif_sk_buffs_tx && !wilc->tx_buffer) {
 		wilc->tx_buffer = kmalloc(WILC_TX_BUFF_SIZE, GFP_KERNEL);
-
-	if (!wilc->tx_buffer) {
-		ret = -ENOBUFS;
-		goto fail;
+		if (!wilc->tx_buffer) {
+			ret = -ENOBUFS;
+			goto fail;
+		}
 	}
 
 	if (!wilc->rx_buffer)