summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2008-01-30 18:20:04 +0900
committerJeff Garzik <jeff@garzik.org>2008-02-01 12:26:44 -0500
commitb95d58eaf20eb33c245a2172ec4ecf46bd832309 (patch)
tree432e1688aeb0b752a1c25c4cc6711b470b008fe9 /drivers
parent9f24e82d07e2c64467d0c0c04a798de56461fd4a (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pci/pci.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 71d561fda0a..7d4ce906d20 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -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) {