aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/pci.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index bfbff8335268..fc8cc6c53778 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -398,10 +398,10 @@ pci_enable_device(struct pci_dev *dev)
398{ 398{
399 int err; 399 int err;
400 400
401 dev->is_enabled = 1;
402 if ((err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1))) 401 if ((err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1)))
403 return err; 402 return err;
404 pci_fixup_device(pci_fixup_enable, dev); 403 pci_fixup_device(pci_fixup_enable, dev);
404 dev->is_enabled = 1;
405 return 0; 405 return 0;
406} 406}
407 407
@@ -427,16 +427,15 @@ pci_disable_device(struct pci_dev *dev)
427{ 427{
428 u16 pci_command; 428 u16 pci_command;
429 429
430 dev->is_enabled = 0;
431 dev->is_busmaster = 0;
432
433 pci_read_config_word(dev, PCI_COMMAND, &pci_command); 430 pci_read_config_word(dev, PCI_COMMAND, &pci_command);
434 if (pci_command & PCI_COMMAND_MASTER) { 431 if (pci_command & PCI_COMMAND_MASTER) {
435 pci_command &= ~PCI_COMMAND_MASTER; 432 pci_command &= ~PCI_COMMAND_MASTER;
436 pci_write_config_word(dev, PCI_COMMAND, pci_command); 433 pci_write_config_word(dev, PCI_COMMAND, pci_command);
437 } 434 }
435 dev->is_busmaster = 0;
438 436
439 pcibios_disable_device(dev); 437 pcibios_disable_device(dev);
438 dev->is_enabled = 0;
440} 439}
441 440
442/** 441/**