diff mbox series

[30/42] mt76x0: alloc mcu buffers first in mt76x0_mcu_cmd_init

Message ID 1536225538-16454-31-git-send-email-sgruszka@redhat.com (mailing list archive)
State New, archived
Headers show
Series mt76 patches 2018-09-06 | expand

Commit Message

Stanislaw Gruszka Sept. 6, 2018, 9:18 a.m. UTC
From: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>

swap mt76u_mcu_init_rx and mt76x0_mcu_function_select in
mt76x0_mcu_cmd_init routine in order to allocate mcu buffers
first and then send mcu commands

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
 drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c
index 0a0deaf1c65d..7be2835f3b4f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c
@@ -387,9 +387,11 @@  int mt76x0_mcu_init(struct mt76x0_dev *dev)
 
 int mt76x0_mcu_cmd_init(struct mt76x0_dev *dev)
 {
-	int ret = mt76x0_mcu_function_select(dev, Q_SELECT, 1);
+	int ret;
+
+	ret = mt76u_mcu_init_rx(&dev->mt76);
 	if (ret)
 		return ret;
 
-	return mt76u_mcu_init_rx(&dev->mt76);
+	return mt76x0_mcu_function_select(dev, Q_SELECT, 1);
 }