Skip to content

Commit

Permalink
wifi: ath10k: Fix return value in ath10k_pci_init()
Browse files Browse the repository at this point in the history
[ Upstream commit 2af7749 ]

This driver is attempting to register to support two different buses.
if either of these is successful then ath10k_pci_init() should return 0
so that hardware attached to the successful bus can be probed and
supported. only if both of these are unsuccessful should ath10k_pci_init()
return an errno.

Fixes: 0b523ce ("ath10k: add basic skeleton to support ahb")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Reviewed-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20221110061926.18163-1-xiujianfeng@huawei.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Xiu Jianfeng authored and gregkh committed Dec 31, 2022
1 parent 77482c4 commit fea795f
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions drivers/net/wireless/ath/ath10k/pci.c
Expand Up @@ -3793,18 +3793,22 @@ static struct pci_driver ath10k_pci_driver = {

static int __init ath10k_pci_init(void)
{
int ret;
int ret1, ret2;

ret = pci_register_driver(&ath10k_pci_driver);
if (ret)
ret1 = pci_register_driver(&ath10k_pci_driver);
if (ret1)
printk(KERN_ERR "failed to register ath10k pci driver: %d\n",
ret);
ret1);

ret = ath10k_ahb_init();
if (ret)
printk(KERN_ERR "ahb init failed: %d\n", ret);
ret2 = ath10k_ahb_init();
if (ret2)
printk(KERN_ERR "ahb init failed: %d\n", ret2);

return ret;
if (ret1 && ret2)
return ret1;

/* registered to at least one bus */
return 0;
}
module_init(ath10k_pci_init);

Expand Down

0 comments on commit fea795f

Please sign in to comment.