Skip to content

Commit

Permalink
mt76: mt7921: honor mt76_connac_mcu_set_rate_txpower return value in …
Browse files Browse the repository at this point in the history
…mt7921_config

Check return code from mt76_connac_mcu_set_rate_txpower() in mt7921_config
routine.

Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
  • Loading branch information
LorenzoBianconi authored and nbd168 committed Dec 19, 2021
1 parent 0a57d63 commit 5d46132
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions drivers/net/wireless/mediatek/mt76/mt7921/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ static int mt7921_config(struct ieee80211_hw *hw, u32 changed)
{
struct mt7921_dev *dev = mt7921_hw_dev(hw);
struct mt7921_phy *phy = mt7921_hw_phy(hw);
int ret;
int ret = 0;

if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
ieee80211_stop_queues(hw);
Expand All @@ -480,8 +480,11 @@ static int mt7921_config(struct ieee80211_hw *hw, u32 changed)

mt7921_mutex_acquire(dev);

if (changed & IEEE80211_CONF_CHANGE_POWER)
mt76_connac_mcu_set_rate_txpower(phy->mt76);
if (changed & IEEE80211_CONF_CHANGE_POWER) {
ret = mt76_connac_mcu_set_rate_txpower(phy->mt76);
if (ret)
goto out;
}

if (changed & IEEE80211_CONF_CHANGE_MONITOR) {
bool enabled = !!(hw->conf.flags & IEEE80211_CONF_MONITOR);
Expand All @@ -496,9 +499,10 @@ static int mt7921_config(struct ieee80211_hw *hw, u32 changed)
mt76_wr(dev, MT_WF_RFCR(0), phy->rxfilter);
}

out:
mt7921_mutex_release(dev);

return 0;
return ret;
}

static int
Expand Down

0 comments on commit 5d46132

Please sign in to comment.