summaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci.c
diff options
context:
space:
mode:
authorKristen Accardi <kristen.c.accardi@intel.com>2006-04-28 20:37:38 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2006-06-21 20:59:59 +0200
commita1e022b3aeacf633a6c8e8f0eb04d9c9e44b4fcd (patch)
tree55f95cedf7056a762caec8c61715bb0422c95f02 /drivers/pci/pci.c
parent[PATCH] PCI: Add a "enable" sysfs attribute to the pci devices to allow users... (diff)
downloadlinux-a1e022b3aeacf633a6c8e8f0eb04d9c9e44b4fcd.tar.xz
linux-a1e022b3aeacf633a6c8e8f0eb04d9c9e44b4fcd.zip
[PATCH] PCI: don't enable device if already enabled
If a device is already enabled, don't bother reenabling it. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Acked-By: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r--drivers/pci/pci.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index fde41cc14734..aa480370ef10 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -517,7 +517,12 @@ pci_enable_device_bars(struct pci_dev *dev, int bars)
int
pci_enable_device(struct pci_dev *dev)
{
- int err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1);
+ int err;
+
+ if (dev->is_enabled)
+ return 0;
+
+ err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1);
if (err)
return err;
pci_fixup_device(pci_fixup_enable, dev);