diff mbox series

mt7603: mcu: run __mt76_mcu_send_msg in mt7603_mcu_send_firmware

Message ID 0fc0574d197f732865dd0e21b08b9f8d2c02890a.1555597590.git.lorenzo@kernel.org (mailing list archive)
State Accepted
Delegated to: Felix Fietkau
Headers show
Series mt7603: mcu: run __mt76_mcu_send_msg in mt7603_mcu_send_firmware | expand

Commit Message

Lorenzo Bianconi April 18, 2019, 2:32 p.m. UTC
Run __mt76_mcu_send_msg instead of __mt7603_mcu_msg_send and remove
duplicated code.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
- this patch is based on 'use standard signature for mt7603 mcu api'
  https://patchwork.kernel.org/cover/10899435/
---
 drivers/net/wireless/mediatek/mt76/mt7603/mcu.c | 15 +++++----------
 1 file changed, 5 insertions(+), 10 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
index 7ebfcb021d40..ca08b546fa0a 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
@@ -122,19 +122,14 @@  mt7603_mcu_init_download(struct mt7603_dev *dev, u32 addr, u32 len)
 static int
 mt7603_mcu_send_firmware(struct mt7603_dev *dev, const void *data, int len)
 {
-	struct sk_buff *skb;
-	int ret = 0;
+	int cur_len, ret = 0;
 
 	while (len > 0) {
-		int cur_len = min_t(int, 4096 - sizeof(struct mt7603_mcu_txd),
-				    len);
-
-		skb = mt7603_mcu_msg_alloc(data, cur_len);
-		if (!skb)
-			return -ENOMEM;
+		cur_len = min_t(int, 4096 - sizeof(struct mt7603_mcu_txd),
+				len);
 
-		ret = __mt7603_mcu_msg_send(dev, skb, -MCU_CMD_FW_SCATTER,
-					    NULL);
+		ret = __mt76_mcu_send_msg(&dev->mt76, -MCU_CMD_FW_SCATTER,
+					  data, cur_len, false);
 		if (ret)
 			break;