]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ionic: use pci_is_enabled not open code
authorShannon Nelson <shannon.nelson@amd.com>
Fri, 16 Feb 2024 22:52:59 +0000 (14:52 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 19 Feb 2024 10:30:51 +0000 (10:30 +0000)
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")
Reviewed-by: Brett Creeley <brett.creeley@amd.com>
Signed-off-by: Shannon Nelson <shannon.nelson@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c

index c49aa358e42444de33b3a3dd08832bf8f56af394..10a9d80db32cb40ff28f21b45de19eccb7bf56de 100644 (file)
@@ -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);
 }