diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2013-04-17 19:38:32 -0400 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2013-04-23 11:50:30 -0400 |
commit | f84ecd285f40012f804173110c10f2caaa23b7ee (patch) | |
tree | d2963ab508de23e966b935512770bcc4e7af4844 | |
parent | f5322169b4bc931c760c6a14484582a95c39edde (diff) |
PCI: Drop msi_control_reg() macro and use PCI_MSI_FLAGS directly
Note the error in pci_msix_table_size() -- we used PCI_MSI_FLAGS to
locate the PCI_MSIX_FLAGS word. No actual breakage because PCI_MSI_FLAGS
and PCI_MSIX_FLAGS happen to be the same.
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
-rw-r--r-- | drivers/pci/msi.c | 8 | ||||
-rw-r--r-- | drivers/pci/msi.h | 1 |
2 files changed, 4 insertions, 5 deletions
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 631249ea394c..b1a60e0a1ee3 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -299,10 +299,10 @@ void __write_msi_msg(struct msi_desc *entry, struct msi_msg *msg) | |||
299 | int pos = dev->msi_cap; | 299 | int pos = dev->msi_cap; |
300 | u16 msgctl; | 300 | u16 msgctl; |
301 | 301 | ||
302 | pci_read_config_word(dev, msi_control_reg(pos), &msgctl); | 302 | pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &msgctl); |
303 | msgctl &= ~PCI_MSI_FLAGS_QSIZE; | 303 | msgctl &= ~PCI_MSI_FLAGS_QSIZE; |
304 | msgctl |= entry->msi_attrib.multiple << 4; | 304 | msgctl |= entry->msi_attrib.multiple << 4; |
305 | pci_write_config_word(dev, msi_control_reg(pos), msgctl); | 305 | pci_write_config_word(dev, pos + PCI_MSI_FLAGS, msgctl); |
306 | 306 | ||
307 | pci_write_config_dword(dev, msi_lower_address_reg(pos), | 307 | pci_write_config_dword(dev, msi_lower_address_reg(pos), |
308 | msg->address_lo); | 308 | msg->address_lo); |
@@ -548,7 +548,7 @@ static int msi_capability_init(struct pci_dev *dev, int nvec) | |||
548 | 548 | ||
549 | msi_set_enable(dev, 0); /* Disable MSI during set up */ | 549 | msi_set_enable(dev, 0); /* Disable MSI during set up */ |
550 | 550 | ||
551 | pci_read_config_word(dev, msi_control_reg(dev->msi_cap), &control); | 551 | pci_read_config_word(dev, dev->msi_cap + PCI_MSI_FLAGS, &control); |
552 | /* MSI Entry Initialization */ | 552 | /* MSI Entry Initialization */ |
553 | entry = alloc_msi_entry(dev); | 553 | entry = alloc_msi_entry(dev); |
554 | if (!entry) | 554 | if (!entry) |
@@ -903,7 +903,7 @@ int pci_msix_table_size(struct pci_dev *dev) | |||
903 | if (!dev->msix_cap) | 903 | if (!dev->msix_cap) |
904 | return 0; | 904 | return 0; |
905 | 905 | ||
906 | pci_read_config_word(dev, msi_control_reg(dev->msix_cap), &control); | 906 | pci_read_config_word(dev, dev->msix_cap + PCI_MSIX_FLAGS, &control); |
907 | return multi_msix_capable(control); | 907 | return multi_msix_capable(control); |
908 | } | 908 | } |
909 | 909 | ||
diff --git a/drivers/pci/msi.h b/drivers/pci/msi.h index 65c42f80f23e..6aa7b1903796 100644 --- a/drivers/pci/msi.h +++ b/drivers/pci/msi.h | |||
@@ -6,7 +6,6 @@ | |||
6 | #ifndef MSI_H | 6 | #ifndef MSI_H |
7 | #define MSI_H | 7 | #define MSI_H |
8 | 8 | ||
9 | #define msi_control_reg(base) (base + PCI_MSI_FLAGS) | ||
10 | #define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO) | 9 | #define msi_lower_address_reg(base) (base + PCI_MSI_ADDRESS_LO) |
11 | #define msi_upper_address_reg(base) (base + PCI_MSI_ADDRESS_HI) | 10 | #define msi_upper_address_reg(base) (base + PCI_MSI_ADDRESS_HI) |
12 | #define msi_data_reg(base, is64bit) \ | 11 | #define msi_data_reg(base, is64bit) \ |