Commit a1e022b3 authored by Kristen Accardi's avatar Kristen Accardi Committed by Greg Kroah-Hartman

[PATCH] PCI: don't enable device if already enabled

If a device is already enabled, don't bother reenabling it.
Signed-off-by: default avatarKristen Carlson Accardi <kristen.c.accardi@intel.com>
Acked-By: default avatarArjan van de Ven <arjan@linux.intel.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9f125d30
...@@ -517,7 +517,12 @@ pci_enable_device_bars(struct pci_dev *dev, int bars) ...@@ -517,7 +517,12 @@ pci_enable_device_bars(struct pci_dev *dev, int bars)
int int
pci_enable_device(struct pci_dev *dev) 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) if (err)
return err; return err;
pci_fixup_device(pci_fixup_enable, dev); pci_fixup_device(pci_fixup_enable, dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment