pci: allow multiple calls to pcim_enable_device()
PATCH 1/1 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.
---
This will be used to fix some libata issues. After Greg's ACK, would it be okay to push this through libata-dev#upstream?
Thanks.
drivers/pci/pci.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/pci/pci.c +2 -1
@@ -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) {
Signature · 1 line
1.5.2.4
Quoted 5 lines · Tejun Heo
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 initialpcim_enable_device()resource is released.
Quoted 7 lines
This allows more flexibility to managed PCI users.
Signed-off-by Tejun Heo <[email protected]>Cc Greg Kroah-Hartman <[email protected]>---
This will be used to fix some libata issues. After Greg's ACK, would it be okay to push this through libata-dev#upstream?
That's fine with me, please add:
To the patch if you want to send it through the ata tree.
thanks,
greg k-h
Jeff Garzik
AppliedQuoted 9 lines · Tejun Heo
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 initialpcim_enable_device()resource is released.This allows more flexibility to managed PCI users.
Signed-off-by Tejun Heo <[email protected]>Cc Greg Kroah-Hartman <[email protected]>
Quoted 8 lines
---
This will be used to fix some libata issues. After Greg's ACK, would it be okay to push this through libata-dev#upstream?Thanks.
drivers/pci/pci.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
applied, w/ greg's sign-off