Skip to content

Commit

Permalink
ionic: use pci_is_enabled not open code
Browse files Browse the repository at this point in the history
Since there is a utility available for this, use
the API rather than open code.

Fixes: 13943d6 ("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>
  • Loading branch information
Shannon Nelson authored and David S. Miller committed Feb 19, 2024
1 parent cd65c48 commit 121e4dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 121e4dc

Please sign in to comment.