* [PATCH v2] wifi: ath10k: Fix return value in ath10k_pci_init()
@ 2022-11-10 3:12 Xiu Jianfeng
2022-11-10 3:25 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Xiu Jianfeng @ 2022-11-10 3:12 UTC (permalink / raw)
To: kvalo, davem, edumazet, kuba, pabeni, rmani
Cc: ath10k, linux-wireless, linux-kernel
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: 0b523ced9a3c ("ath10k: add basic skeleton to support ahb")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
v2: modify according to Jeff's suggestion, and change the commit message
and body as well.
---
drivers/net/wireless/ath/ath10k/pci.c | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index e56c6a6b1379..728d607289c3 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -3792,18 +3792,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);
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] wifi: ath10k: Fix return value in ath10k_pci_init()
2022-11-10 3:12 [PATCH v2] wifi: ath10k: Fix return value in ath10k_pci_init() Xiu Jianfeng
@ 2022-11-10 3:25 ` Jakub Kicinski
2022-11-10 4:00 ` xiujianfeng
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2022-11-10 3:25 UTC (permalink / raw)
To: Xiu Jianfeng
Cc: kvalo, davem, edumazet, pabeni, rmani, ath10k, linux-wireless,
linux-kernel
On Thu, 10 Nov 2022 11:12:28 +0800 Xiu Jianfeng wrote:
> To: <kvalo@kernel.org>, <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>, <rmani@qti.qualcomm.com>
> CC: <ath10k@lists.infradead.org>, <linux-wireless@vger.kernel.org>, <linux-kernel@vger.kernel.org>
How did you come up with this CC list? If you're CCing netdev
maintainers you should also CC netdev@vger.kernel.org
Somehow you managed to CC LMKL but not netdev :S
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] wifi: ath10k: Fix return value in ath10k_pci_init()
2022-11-10 3:25 ` Jakub Kicinski
@ 2022-11-10 4:00 ` xiujianfeng
0 siblings, 0 replies; 3+ messages in thread
From: xiujianfeng @ 2022-11-10 4:00 UTC (permalink / raw)
To: Jakub Kicinski
Cc: kvalo, davem, edumazet, pabeni, rmani, ath10k, linux-wireless,
linux-kernel
在 2022/11/10 11:25, Jakub Kicinski 写道:
> On Thu, 10 Nov 2022 11:12:28 +0800 Xiu Jianfeng wrote:
>> To: <kvalo@kernel.org>, <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>, <rmani@qti.qualcomm.com>
>> CC: <ath10k@lists.infradead.org>, <linux-wireless@vger.kernel.org>, <linux-kernel@vger.kernel.org>
>
> How did you come up with this CC list? If you're CCing netdev
> maintainers you should also CC netdev@vger.kernel.org
> Somehow you managed to CC LMKL but not netdev :S
> .
Sorry, I may missed that, I will resend this patch.
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-10 4:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-10 3:12 [PATCH v2] wifi: ath10k: Fix return value in ath10k_pci_init() Xiu Jianfeng
2022-11-10 3:25 ` Jakub Kicinski
2022-11-10 4:00 ` xiujianfeng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).