aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/msi.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pci/msi.c')
-rw-r--r--drivers/pci/msi.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 4aea563bda60..9c69b6966e79 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -940,14 +940,13 @@ int pci_enable_msi(struct pci_dev* dev)
940 if (!pos) 940 if (!pos)
941 return -EINVAL; 941 return -EINVAL;
942 942
943 pci_read_config_word(dev, msi_control_reg(pos), &control);
944 if (control & PCI_MSI_FLAGS_ENABLE)
945 return 0; /* Already in MSI mode */
946
947 if (!msi_lookup_vector(dev, PCI_CAP_ID_MSI)) { 943 if (!msi_lookup_vector(dev, PCI_CAP_ID_MSI)) {
948 /* Lookup Sucess */ 944 /* Lookup Sucess */
949 unsigned long flags; 945 unsigned long flags;
950 946
947 pci_read_config_word(dev, msi_control_reg(pos), &control);
948 if (control & PCI_MSI_FLAGS_ENABLE)
949 return 0; /* Already in MSI mode */
951 spin_lock_irqsave(&msi_lock, flags); 950 spin_lock_irqsave(&msi_lock, flags);
952 if (!vector_irq[dev->irq]) { 951 if (!vector_irq[dev->irq]) {
953 msi_desc[dev->irq]->msi_attrib.state = 0; 952 msi_desc[dev->irq]->msi_attrib.state = 0;