[PATCH] PCI: don't enable device if already enabled
authorKristen Accardi <kristen.c.accardi@intel.com>
Fri, 28 Apr 2006 18:37:38 +0000 (11:37 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 Jun 2006 18:59:59 +0000 (11:59 -0700)
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>
drivers/pci/pci.c

index fde41cc147344d3faf1bca11078dc951062e01be..aa480370ef1019b7ca435870aaa3904d757310f9 100644 (file)
@@ -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);