summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLorenzo Bianconi <lorenzo.bianconi@redhat.com>2018-09-10 00:57:54 +0300
committerFelix Fietkau <nbd@nbd.name>2018-09-19 13:31:29 +0300
commit8799b624fe744f1cc8a48835c9b6469166ef5188 (patch)
treedf3d795a0e912938b692f810f57209aeb39237d0 /drivers
parent331419b2ce6eb97c6a042d34bbacd79ff5fb5cf1 (diff)
downloadlinux-8799b624fe744f1cc8a48835c9b6469166ef5188.tar.xz
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: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c4
-rw-r--r--drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c20
2 files changed, 0 insertions, 24 deletions
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c
index 4a5739e056a7..d757cde33f74 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x0/mcu.c
@@ -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);
}
diff --git a/drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c
index 09afb8c5d851..e93123e4a395 100644
--- a/drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt76x2u_mcu.c
@@ -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);
}