Skip to content

Commit ff9f732

Browse files
Anilkumar KolliKalle Valo
authored andcommitted
ath11k: fix warning in ath11k_mhi_config
Initialize static variable ath11k_mhi_config for all hw_rev, return error for unknown hw_rev. This patch fixes below Smatch warning: drivers/net/wireless/ath/ath11k/mhi.c:357 ath11k_mhi_register() error: uninitialized symbol 'ath11k_mhi_config'. Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.4.0.1-01734-QCAHKSWPL_SILICONZ-1 Fixes: a233811 ("ath11k: Add qcn9074 mhi controller config") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Anilkumar Kolli <akolli@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/1617857830-19315-1-git-send-email-akolli@codeaurora.org
1 parent 6dc89f0 commit ff9f732

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

  • drivers/net/wireless/ath/ath11k

‎drivers/net/wireless/ath/ath11k/mhi.c‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,19 @@ int ath11k_mhi_register(struct ath11k_pci *ab_pci)
349349
mhi_ctrl->read_reg = ath11k_mhi_op_read_reg;
350350
mhi_ctrl->write_reg = ath11k_mhi_op_write_reg;
351351

352-
if (ab->hw_rev == ATH11K_HW_QCA6390_HW20)
353-
ath11k_mhi_config = &ath11k_mhi_config_qca6390;
354-
else if (ab->hw_rev == ATH11K_HW_QCN9074_HW10)
352+
switch (ab->hw_rev) {
353+
case ATH11K_HW_QCN9074_HW10:
355354
ath11k_mhi_config = &ath11k_mhi_config_qcn9074;
355+
break;
356+
case ATH11K_HW_QCA6390_HW20:
357+
ath11k_mhi_config = &ath11k_mhi_config_qca6390;
358+
break;
359+
default:
360+
ath11k_err(ab, "failed assign mhi_config for unknown hw rev %d\n",
361+
ab->hw_rev);
362+
mhi_free_controller(mhi_ctrl);
363+
return -EINVAL;
364+
}
356365

357366
ret = mhi_register_controller(mhi_ctrl, ath11k_mhi_config);
358367
if (ret) {

0 commit comments

Comments
 (0)