mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-24 22:30:52 +07:00
pci: allow multiple calls to pcim_enable_device()
There's no reason not to allow multiple calls to pcim_enable_device(). Calls after the first one can simply be noop. All PCI resources will be released when the initial pcim_enable_device() resource is released. This allows more flexibility to managed PCI users. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
parent
9f24e82d07
commit
b95d58eaf2
@ -823,7 +823,8 @@ int pcim_enable_device(struct pci_dev *pdev)
|
||||
dr = get_pci_dr(pdev);
|
||||
if (unlikely(!dr))
|
||||
return -ENOMEM;
|
||||
WARN_ON(!!dr->enabled);
|
||||
if (dr->enabled)
|
||||
return 0;
|
||||
|
||||
rc = pci_enable_device(pdev);
|
||||
if (!rc) {
|
||||
|
Loading…
Reference in New Issue
Block a user