diff options
author | Felix Fietkau <nbd@nbd.name> | 2020-09-30 05:35:11 +0300 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2020-12-04 15:46:15 +0300 |
commit | e452c6eb55fbfd21eef6e95f63a0265655d5b677 (patch) | |
tree | bf4d4b241691f580790abc6363eeb7a713055312 /drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c | |
parent | 96a607b643e2d81351a9de584928928d3e54f395 (diff) | |
download | linux-e452c6eb55fbfd21eef6e95f63a0265655d5b677.tar.xz |
mt76: move waiting and locking out of mcu_ops->mcu_skb_send_msg
This removes some code duplication and prepares the code for making
the MCU API more flexible
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c')
-rw-r--r-- | drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c index 263f3a65878f..e48169395077 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/sdio_mcu.c @@ -41,24 +41,17 @@ static int mt7663s_mcu_init_sched(struct mt7615_dev *dev) static int mt7663s_mcu_send_message(struct mt76_dev *mdev, struct sk_buff *skb, - int cmd, bool wait_resp) + int cmd, int *seq) { struct mt7615_dev *dev = container_of(mdev, struct mt7615_dev, mt76); - int ret, seq; - - mutex_lock(&mdev->mcu.mutex); + int ret; - mt7615_mcu_fill_msg(dev, skb, cmd, &seq); + mt7615_mcu_fill_msg(dev, skb, cmd, seq); ret = mt76_tx_queue_skb_raw(dev, MT_TXQ_MCU, skb, 0); if (ret) - goto out; + return ret; mt76_queue_kick(dev, mdev->q_tx[MT_TXQ_MCU]); - if (wait_resp) - ret = mt7615_mcu_wait_response(dev, cmd, seq); - -out: - mutex_unlock(&mdev->mcu.mutex); return ret; } |