summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo@kernel.org>2019-04-18 16:32:00 +0200
committerFelix Fietkau <nbd@nbd.name>2019-05-01 13:04:00 +0200
commitd422bb261733f469ca98183b937b63366283263a (patch)
tree847b7b0b03b1a5279c152289a298bac29b77d4b7
parenta4834814e1d3376e07c00ecf339f1c4b8818c8a2 (diff)
downloadlinux-d422bb261733f469ca98183b937b63366283263a.tar.gz
linux-d422bb261733f469ca98183b937b63366283263a.tar.bz2
linux-d422bb261733f469ca98183b937b63366283263a.zip
mt76: mt7603: run __mt76_mcu_send_msg in mt7603_mcu_send_firmware
Run __mt76_mcu_send_msg instead of __mt7603_mcu_msg_send and remove duplicated code. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt7603/mcu.c15
1 files changed, 5 insertions, 10 deletions
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;