Commit 8799b624 authored by Lorenzo Bianconi's avatar Lorenzo Bianconi Committed by Felix Fietkau

mt76: usb: remove skb check in mt76x{0,2}u mcu routines

Remove mt76_mcu_msg_alloc return value check since it is already
evaluated in __mt76x02u_mcu_send_msg
Signed-off-by: default avatarLorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
parent 331419b2
......@@ -54,8 +54,6 @@ int mt76x0_mcu_function_select(struct mt76x0_dev *dev,
};
skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg));
if (!skb)
return -ENOMEM;
return mt76_mcu_send_msg(dev, skb, CMD_FUN_SET_OP, func == 5);
}
......@@ -72,8 +70,6 @@ mt76x0_mcu_calibrate(struct mt76x0_dev *dev, enum mcu_calibrate cal, u32 val)
};
skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg));
if (!skb)
return -ENOMEM;
return mt76_mcu_send_msg(dev, skb, CMD_CALIBRATION_OP, true);
}
......
......@@ -43,8 +43,6 @@ mt76x2u_mcu_function_select(struct mt76x2_dev *dev, enum mcu_function func,
struct sk_buff *skb;
skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg));
if (!skb)
return -ENOMEM;
return mt76_mcu_send_msg(dev, skb, CMD_FUN_SET_OP,
func != Q_SELECT);
}
......@@ -61,8 +59,6 @@ int mt76x2u_mcu_set_radio_state(struct mt76x2_dev *dev, bool val)
struct sk_buff *skb;
skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg));
if (!skb)
return -ENOMEM;
return mt76_mcu_send_msg(dev, skb, CMD_POWER_SAVING_OP,
false);
}
......@@ -91,8 +87,6 @@ int mt76x2u_mcu_load_cr(struct mt76x2_dev *dev, u8 type, u8 temp_level,
/* first set the channel without the extension channel info */
skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg));
if (!skb)
return -ENOMEM;
return mt76_mcu_send_msg(dev, skb, CMD_LOAD_CR, true);
}
......@@ -119,18 +113,12 @@ int mt76x2u_mcu_set_channel(struct mt76x2_dev *dev, u8 channel, u8 bw,
/* first set the channel without the extension channel info */
skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg));
if (!skb)
return -ENOMEM;
mt76_mcu_send_msg(dev, skb, CMD_SWITCH_CHANNEL_OP, true);
usleep_range(5000, 10000);
msg.ext_chan = 0xe0 + bw_index;
skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg));
if (!skb)
return -ENOMEM;
return mt76_mcu_send_msg(dev, skb, CMD_SWITCH_CHANNEL_OP, true);
}
......@@ -147,8 +135,6 @@ int mt76x2u_mcu_calibrate(struct mt76x2_dev *dev, enum mcu_calibration type,
struct sk_buff *skb;
skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg));
if (!skb)
return -ENOMEM;
return mt76_mcu_send_msg(dev, skb, CMD_CALIBRATION_OP, true);
}
......@@ -168,8 +154,6 @@ int mt76x2u_mcu_init_gain(struct mt76x2_dev *dev, u8 channel, u32 gain,
msg.channel |= cpu_to_le32(BIT(31));
skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg));
if (!skb)
return -ENOMEM;
return mt76_mcu_send_msg(dev, skb, CMD_INIT_GAIN_OP, true);
}
......@@ -194,8 +178,6 @@ int mt76x2u_mcu_set_dynamic_vga(struct mt76x2_dev *dev, u8 channel, bool ap,
msg.channel = cpu_to_le32(val);
skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg));
if (!skb)
return -ENOMEM;
return mt76_mcu_send_msg(dev, skb, CMD_DYNC_VGA_OP, true);
}
......@@ -212,8 +194,6 @@ int mt76x2u_mcu_tssi_comp(struct mt76x2_dev *dev,
struct sk_buff *skb;
skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg));
if (!skb)
return -ENOMEM;
return mt76_mcu_send_msg(dev, skb, CMD_CALIBRATION_OP, true);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment