Skip to content

Commit 2af7749

Browse files
Xiu Jianfengkvalo
authored andcommitted
wifi: ath10k: Fix return value in ath10k_pci_init()
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 <[email protected]> Reviewed-by: Jeff Johnson <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent a60c040 commit 2af7749

File tree

1 file changed

+12
-8
lines changed
  • drivers/net/wireless/ath/ath10k

1 file changed

+12
-8
lines changed

drivers/net/wireless/ath/ath10k/pci.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3792,18 +3792,22 @@ static struct pci_driver ath10k_pci_driver = {
37923792

37933793
static int __init ath10k_pci_init(void)
37943794
{
3795-
int ret;
3795+
int ret1, ret2;
37963796

3797-
ret = pci_register_driver(&ath10k_pci_driver);
3798-
if (ret)
3797+
ret1 = pci_register_driver(&ath10k_pci_driver);
3798+
if (ret1)
37993799
printk(KERN_ERR "failed to register ath10k pci driver: %d\n",
3800-
ret);
3800+
ret1);
38013801

3802-
ret = ath10k_ahb_init();
3803-
if (ret)
3804-
printk(KERN_ERR "ahb init failed: %d\n", ret);
3802+
ret2 = ath10k_ahb_init();
3803+
if (ret2)
3804+
printk(KERN_ERR "ahb init failed: %d\n", ret2);
38053805

3806-
return ret;
3806+
if (ret1 && ret2)
3807+
return ret1;
3808+
3809+
/* registered to at least one bus */
3810+
return 0;
38073811
}
38083812
module_init(ath10k_pci_init);
38093813

0 commit comments

Comments
 (0)