]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mt7615: mcu: run __mt76_mcu_send_msg in mt7615_mcu_send_firmware
authorLorenzo Bianconi <lorenzo@kernel.org>
Sat, 4 May 2019 15:29:09 +0000 (17:29 +0200)
committerFelix Fietkau <nbd@nbd.name>
Tue, 25 Jun 2019 10:55:26 +0000 (12:55 +0200)
Run __mt76_mcu_send_msg instead of __mt7615_mcu_msg_send and remove
duplicated code.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c

index cf90453c47505d5c1b40cd8ea44b3263ab56ef7e..43f70195244c8352575bde9278832f197340959a 100644 (file)
@@ -179,19 +179,14 @@ static int mt7615_mcu_init_download(struct mt7615_dev *dev, u32 addr,
 static int mt7615_mcu_send_firmware(struct mt7615_dev *dev, const void *data,
                                    int len)
 {
-       struct sk_buff *skb;
-       int ret = 0;
+       int ret = 0, cur_len;
 
        while (len > 0) {
-               int cur_len = min_t(int, 4096 - sizeof(struct mt7615_mcu_txd),
-                                   len);
-
-               skb = mt7615_mcu_msg_alloc(data, cur_len);
-               if (!skb)
-                       return -ENOMEM;
+               cur_len = min_t(int, 4096 - sizeof(struct mt7615_mcu_txd),
+                               len);
 
-               ret = __mt7615_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;