Skip to contentSkip to conversation

ionic: use pci_is_enabled not open code

PATCH Applied Shannon Nelson 2 participants 2 messages Feb 16, 2024 – Feb 19, 2024

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ionic: use pci_is_enabled not open code

Since there is a utility available for this, use
the API rather than open code.

Fixes 13943d6c8273 ("ionic: prevent pci disable of already disabled device")
---
 drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c +1 -1
index c49aa358e424..10a9d80db32c 100644
@@ -223,7 +223,7 @@ static void ionic_clear_pci(struct ionic *ionic)
 	ionic_unmap_bars(ionic);
 	pci_release_regions(ionic->pdev);
 
-	if (atomic_read(&ionic->pdev->enable_cnt) > 0)
+	if (pci_is_enabled(ionic->pdev))
 		pci_disable_device(ionic->pdev);
 }
 
Signature · 1 line
2.17.1
#1 lore raw
This patch was applied to netdev/net.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by David S. Miller <[email protected]>:

Quoted 8 lines · On Fri, 16 Feb 2024 14:52:59 -0800 you wrote:

Since there is a utility available for this, use
the API rather than open code.

Fixes 13943d6c8273 ("ionic: prevent pci disable of already disabled device")

[...]

Here is the summary with links:
- [net] ionic: use pci_is_enabled not open code

    https://git.kernel.org/netdev/net/c/121e4dcba370

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html