* [PATCH] wifi: ath12k: remove redundant pci_set_drvdata() call
@ 2025-11-26 17:02 Alexander Minchev
2025-11-26 17:03 ` Alexander Minchev
2025-11-27 7:28 ` [PATCH v2] " Alexander Minchev
0 siblings, 2 replies; 6+ messages in thread
From: Alexander Minchev @ 2025-11-26 17:02 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless
Hi,
this patch removes a redundant pci_set_drvdata() call in
ath12k_pci_probe() and keeps a single call after initialization is
complete.
I noticed the same double function call in ath11k's pci.c in the same
context, but I do not have ath11k compatible hardware to test a similar
change there.
Thanks,
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] wifi: ath12k: remove redundant pci_set_drvdata() call
2025-11-26 17:02 [PATCH] wifi: ath12k: remove redundant pci_set_drvdata() call Alexander Minchev
@ 2025-11-26 17:03 ` Alexander Minchev
2025-11-27 1:59 ` Baochen Qiang
2025-11-27 7:28 ` [PATCH v2] " Alexander Minchev
1 sibling, 1 reply; 6+ messages in thread
From: Alexander Minchev @ 2025-11-26 17:03 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, Alexander Minchev
pci_set_drvdata() is called twice in ath12k_pci_probe() with the
same pointer. Remove the earlier call so drvdata is set after
ath12k_base and ath12k_pci initialization is complete.
Having two calls might suggest that drvdata needs to be set early for
some reason, even though it is not used until after the 'ab' struct
ath12k_base is fully populated. even though exact placement is
not critical, keeping a single pci_set_drvdata() at the end of
the initialization makes it clearer that drvdata points to a
fully initialized structure and avoids confusion for future changes.
Tested on: WCN7850 hw2.0 PCI
WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3
Signed-off-by: Alexander Minchev <adminchev@proton.me>
---
drivers/net/wireless/ath/ath12k/pci.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index a12c8379cb46..7bf98618ac1e 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -1580,7 +1580,6 @@ static int ath12k_pci_probe(struct pci_dev *pdev,
}
ab->dev = &pdev->dev;
- pci_set_drvdata(pdev, ab);
ab_pci = ath12k_pci_priv(ab);
ab_pci->dev_id = pci_dev->device;
ab_pci->ab = ab;
--
2.52.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] wifi: ath12k: remove redundant pci_set_drvdata() call
2025-11-26 17:03 ` Alexander Minchev
@ 2025-11-27 1:59 ` Baochen Qiang
0 siblings, 0 replies; 6+ messages in thread
From: Baochen Qiang @ 2025-11-27 1:59 UTC (permalink / raw)
To: Alexander Minchev, ath12k; +Cc: linux-wireless
On 11/27/2025 1:03 AM, Alexander Minchev wrote:
> pci_set_drvdata() is called twice in ath12k_pci_probe() with the
> same pointer. Remove the earlier call so drvdata is set after
> ath12k_base and ath12k_pci initialization is complete.
>
> Having two calls might suggest that drvdata needs to be set early for
> some reason, even though it is not used until after the 'ab' struct
> ath12k_base is fully populated. even though exact placement is
nit: s/even/Even/
> not critical, keeping a single pci_set_drvdata() at the end of
> the initialization makes it clearer that drvdata points to a
> fully initialized structure and avoids confusion for future changes.
>
==>
> Tested on: WCN7850 hw2.0 PCI
> WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3
<==
nit: this has to be on the same line
>
> Signed-off-by: Alexander Minchev <adminchev@proton.me>
> ---
> drivers/net/wireless/ath/ath12k/pci.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
> index a12c8379cb46..7bf98618ac1e 100644
> --- a/drivers/net/wireless/ath/ath12k/pci.c
> +++ b/drivers/net/wireless/ath/ath12k/pci.c
> @@ -1580,7 +1580,6 @@ static int ath12k_pci_probe(struct pci_dev *pdev,
> }
>
> ab->dev = &pdev->dev;
> - pci_set_drvdata(pdev, ab);
> ab_pci = ath12k_pci_priv(ab);
> ab_pci->dev_id = pci_dev->device;
> ab_pci->ab = ab;
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] wifi: ath12k: remove redundant pci_set_drvdata() call
2025-11-26 17:02 [PATCH] wifi: ath12k: remove redundant pci_set_drvdata() call Alexander Minchev
2025-11-26 17:03 ` Alexander Minchev
@ 2025-11-27 7:28 ` Alexander Minchev
2025-11-27 7:29 ` Alexander Minchev
1 sibling, 1 reply; 6+ messages in thread
From: Alexander Minchev @ 2025-11-27 7:28 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless
Hi,
thank you for the prompt review, I appreciate it. The issues are
addressed in this v2. Please let me know if anything else needs to be
changed.
Thanks,
Alex
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v2] wifi: ath12k: remove redundant pci_set_drvdata() call
2025-11-27 7:28 ` [PATCH v2] " Alexander Minchev
@ 2025-11-27 7:29 ` Alexander Minchev
2026-01-16 1:26 ` Jeff Johnson
0 siblings, 1 reply; 6+ messages in thread
From: Alexander Minchev @ 2025-11-27 7:29 UTC (permalink / raw)
To: ath12k; +Cc: linux-wireless, Alexander Minchev, Baochen Qiang
pci_set_drvdata() is called twice in ath12k_pci_probe() with the
same pointer. Remove the earlier call so drvdata is set after
ath12k_base and ath12k_pci initialization is complete.
Having two calls might suggest that drvdata needs to be set early for
some reason, even though it is not used until after the 'ab' struct
ath12k_base is fully populated. Even though exact placement is
not critical, keeping a single pci_set_drvdata() at the end of
the initialization makes it clearer that drvdata points to a
fully initialized structure and avoids confusion for future changes.
Tested on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Signed-off-by: Alexander Minchev <adminchev@proton.me>
---
drivers/net/wireless/ath/ath12k/pci.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath12k/pci.c b/drivers/net/wireless/ath/ath12k/pci.c
index a12c8379cb46..7bf98618ac1e 100644
--- a/drivers/net/wireless/ath/ath12k/pci.c
+++ b/drivers/net/wireless/ath/ath12k/pci.c
@@ -1580,7 +1580,6 @@ static int ath12k_pci_probe(struct pci_dev *pdev,
}
ab->dev = &pdev->dev;
- pci_set_drvdata(pdev, ab);
ab_pci = ath12k_pci_priv(ab);
ab_pci->dev_id = pci_dev->device;
ab_pci->ab = ab;
--
2.52.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v2] wifi: ath12k: remove redundant pci_set_drvdata() call
2025-11-27 7:29 ` Alexander Minchev
@ 2026-01-16 1:26 ` Jeff Johnson
0 siblings, 0 replies; 6+ messages in thread
From: Jeff Johnson @ 2026-01-16 1:26 UTC (permalink / raw)
To: ath12k, Alexander Minchev; +Cc: linux-wireless, Baochen Qiang
On Thu, 27 Nov 2025 07:29:37 +0000, Alexander Minchev wrote:
> pci_set_drvdata() is called twice in ath12k_pci_probe() with the
> same pointer. Remove the earlier call so drvdata is set after
> ath12k_base and ath12k_pci initialization is complete.
>
> Having two calls might suggest that drvdata needs to be set early for
> some reason, even though it is not used until after the 'ab' struct
> ath12k_base is fully populated. Even though exact placement is
> not critical, keeping a single pci_set_drvdata() at the end of
> the initialization makes it clearer that drvdata points to a
> fully initialized structure and avoids confusion for future changes.
>
> [...]
Applied, thanks!
[1/1] wifi: ath12k: remove redundant pci_set_drvdata() call
commit: 8fb264d1a0c5b3feae5f492ee2bc2997b71b63e3
Best regards,
--
Jeff Johnson <jeff.johnson@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-01-16 1:26 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-26 17:02 [PATCH] wifi: ath12k: remove redundant pci_set_drvdata() call Alexander Minchev
2025-11-26 17:03 ` Alexander Minchev
2025-11-27 1:59 ` Baochen Qiang
2025-11-27 7:28 ` [PATCH v2] " Alexander Minchev
2025-11-27 7:29 ` Alexander Minchev
2026-01-16 1:26 ` Jeff Johnson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox