mt76: mt7915: honor all possible error conditions in mt7915_mcu_init()

Check all possible errors returned in mt7915_mcu_init routine.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
Lorenzo Bianconi 2021-09-12 17:49:50 +02:00 committed by Felix Fietkau
parent b5cdb4f9d1
commit 706dc08c29

View File

@ -416,7 +416,7 @@ exit:
return mt76_tx_queue_skb_raw(dev, mdev->q_mcu[qid], skb, 0);
}
static void
static int
mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3)
{
struct {
@ -429,7 +429,7 @@ mt7915_mcu_wa_cmd(struct mt7915_dev *dev, int cmd, u32 a1, u32 a2, u32 a3)
},
};
mt76_mcu_send_msg(&dev->mt76, cmd, &req, sizeof(req), true);
return mt76_mcu_send_msg(&dev->mt76, cmd, &req, sizeof(req), true);
}
static void
@ -2889,11 +2889,16 @@ int mt7915_mcu_init(struct mt7915_dev *dev)
return ret;
set_bit(MT76_STATE_MCU_RUNNING, &dev->mphy.state);
mt7915_mcu_fw_log_2_host(dev, 0);
mt7915_mcu_set_mwds(dev, 1);
mt7915_mcu_wa_cmd(dev, MCU_WA_PARAM_CMD(SET), MCU_WA_PARAM_RED, 0, 0);
ret = mt7915_mcu_fw_log_2_host(dev, 0);
if (ret)
return ret;
return 0;
ret = mt7915_mcu_set_mwds(dev, 1);
if (ret)
return ret;
return mt7915_mcu_wa_cmd(dev, MCU_WA_PARAM_CMD(SET),
MCU_WA_PARAM_RED, 0, 0);
}
void mt7915_mcu_exit(struct mt7915_dev *dev)