diff options
author | Kristen Accardi <kristen.c.accardi@intel.com> | 2006-04-28 14:37:38 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 14:59:59 -0400 |
commit | a1e022b3aeacf633a6c8e8f0eb04d9c9e44b4fcd (patch) | |
tree | 55f95cedf7056a762caec8c61715bb0422c95f02 /drivers | |
parent | 9f125d30487cea72542a84b4835c037163c7f3d5 (diff) |
[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')
-rw-r--r-- | drivers/pci/pci.c | 7 |
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) | |||
517 | int | 517 | int |
518 | pci_enable_device(struct pci_dev *dev) | 518 | pci_enable_device(struct pci_dev *dev) |
519 | { | 519 | { |
520 | int err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1); | 520 | int err; |
521 | |||
522 | if (dev->is_enabled) | ||
523 | return 0; | ||
524 | |||
525 | err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1); | ||
521 | if (err) | 526 | if (err) |
522 | return err; | 527 | return err; |
523 | pci_fixup_device(pci_fixup_enable, dev); | 528 | pci_fixup_device(pci_fixup_enable, dev); |