diff mbox series

ath9k: use unmanaged PCI functions in ath9k_pci_owl_loader

Message ID cd66af0c-835e-4222-b362-e2e9cafdeb40@gmail.com (mailing list archive)
State Superseded
Delegated to: Bjorn Helgaas
Headers show
Series ath9k: use unmanaged PCI functions in ath9k_pci_owl_loader | expand

Commit Message

Heiner Kallweit April 1, 2024, 3:30 p.m. UTC
Using the device-managed versions has no benefit here, because
resources are released as part of the asynchronous fw loading.

Actual reason why I got here is that I was looking for places with
dubious use of pcim_pin_device().

Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
 drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

Comments

Toke Høiland-Jørgensen April 3, 2024, 9:23 p.m. UTC | #1
Heiner Kallweit <hkallweit1@gmail.com> writes:

> Using the device-managed versions has no benefit here, because
> resources are released as part of the asynchronous fw loading.
>
> Actual reason why I got here is that I was looking for places with
> dubious use of pcim_pin_device().

Could you please expand the commit message to explain what this means in
a bit more detail? That will be helpful to someone who wants to
understand what the difference between these versions is and why this
change makes sense, but who is not that familiar with how these internal
bits are really supposed to work. Someone like myself, in other words :)

-Toke
Heiner Kallweit April 4, 2024, 9:07 p.m. UTC | #2
On 03.04.2024 23:23, Toke Høiland-Jørgensen wrote:
> Heiner Kallweit <hkallweit1@gmail.com> writes:
> 
>> Using the device-managed versions has no benefit here, because
>> resources are released as part of the asynchronous fw loading.
>>
>> Actual reason why I got here is that I was looking for places with
>> dubious use of pcim_pin_device().
> 
> Could you please expand the commit message to explain what this means in
> a bit more detail? That will be helpful to someone who wants to
> understand what the difference between these versions is and why this
> change makes sense, but who is not that familiar with how these internal
> bits are really supposed to work. Someone like myself, in other words :)
> 
Sure. I'll add some more context in a v2.

> -Toke
Heiner
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c b/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
index a5eb43f30..bc93ca075 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
+++ b/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
@@ -65,7 +65,7 @@  static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data,
 
 	dev_info(&pdev->dev, "fixup device configuration\n");
 
-	mem = pcim_iomap(pdev, 0, 0);
+	mem = pci_iomap(pdev, 0, 0);
 	if (!mem) {
 		dev_err(&pdev->dev, "ioremap error\n");
 		return -EINVAL;
@@ -103,7 +103,7 @@  static int ath9k_pci_fixup(struct pci_dev *pdev, const u16 *cal_data,
 	pci_write_config_word(pdev, PCI_COMMAND, cmd);
 
 	pci_write_config_dword(pdev, PCI_BASE_ADDRESS_0, bar0);
-	pcim_iounmap(pdev, mem);
+	pci_iounmap(pdev, mem);
 
 	pci_disable_device(pdev);
 
@@ -200,11 +200,9 @@  static int owl_probe(struct pci_dev *pdev,
 	const char *eeprom_name;
 	int err = 0;
 
-	if (pcim_enable_device(pdev))
+	if (pci_enable_device(pdev))
 		return -EIO;
 
-	pcim_pin_device(pdev);
-
 	ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
 	if (!ctx)
 		return -ENOMEM;