summaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorKenji Kaneshige <kaneshige.kenji@soft.fujitsu.com>2005-04-08 14:53:31 +0900
committerGreg KH <gregkh@suse.de>2005-05-03 23:45:13 -0700
commitceb43744cd48a20212e2179e0c7ff2f450a3c97e (patch)
treef9554643bc9d70fe761840a603adce393c0e9f08 /drivers/pci
parent8800cea62025a5209d110c5fa5990429239d6eee (diff)
downloadop-kernel-dev-ceb43744cd48a20212e2179e0c7ff2f450a3c97e.zip
op-kernel-dev-ceb43744cd48a20212e2179e0c7ff2f450a3c97e.tar.gz
[PATCH] PCI: 'is_enabled' flag should be set/cleared when the device is actually enabled/disabled
I think 'is_enabled' flag in pci_dev structure should be set/cleared when the device actually enabled/disabled. Especially about pci_enable_device(), it can be failed. By this change, we will also get the possibility of refering 'is_enabled' flag from the functions called through pci_enable_device()/pci_disable_device(). Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 bfbff83..fc8cc6c 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -398,10 +398,10 @@ pci_enable_device(struct pci_dev *dev)
{
int err;
- dev->is_enabled = 1;
if ((err = pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1)))
return err;
pci_fixup_device(pci_fixup_enable, dev);
+ dev->is_enabled = 1;
return 0;
}
@@ -427,16 +427,15 @@ pci_disable_device(struct pci_dev *dev)
{
u16 pci_command;
- dev->is_enabled = 0;
- dev->is_busmaster = 0;
-
pci_read_config_word(dev, PCI_COMMAND, &pci_command);
if (pci_command & PCI_COMMAND_MASTER) {
pci_command &= ~PCI_COMMAND_MASTER;
pci_write_config_word(dev, PCI_COMMAND, pci_command);
}
+ dev->is_busmaster = 0;
pcibios_disable_device(dev);
+ dev->is_enabled = 0;
}
/**
OpenPOWER on IntegriCloud