[PATCH] wifi: ath12k: remove redundant pci_set_drvdata() call
Baochen Qiang
baochen.qiang at oss.qualcomm.com
Wed Nov 26 17:59:56 PST 2025
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 at 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 at oss.qualcomm.com>
More information about the ath12k
mailing list