From: Alexander Minchev <adminchev@proton.me>
To: ath12k@lists.infradead.org
Cc: linux-wireless@vger.kernel.org,
Alexander Minchev <adminchev@proton.me>,
Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Subject: [PATCH v2] wifi: ath12k: remove redundant pci_set_drvdata() call
Date: Thu, 27 Nov 2025 07:29:37 +0000 [thread overview]
Message-ID: <20251127072839.14167-2-adminchev@proton.me> (raw)
In-Reply-To: <20251127072839.14167-1-adminchev@proton.me>
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
next prev parent reply other threads:[~2025-11-27 7:29 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-01-16 1:26 ` Jeff Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251127072839.14167-2-adminchev@proton.me \
--to=adminchev@proton.me \
--cc=ath12k@lists.infradead.org \
--cc=baochen.qiang@oss.qualcomm.com \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox