Commit 39118e31 authored by Jiang Liu's avatar Jiang Liu Committed by Thomas Gleixner

x86/PCI: Use for_pci_msi_entry() to access MSI device list

Use accessor for_each_pci_msi_entry() to access MSI device list, so we
could easily move msi_list from struct pci_dev into struct device
later.
Signed-off-by: default avatarJiang Liu <jiang.liu@linux.intel.com>
Acked-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Tony Luck <tony.luck@intel.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: xen-devel@lists.xenproject.org
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Cc: Stuart Yoder <stuart.yoder@freescale.com>
Cc: Yijing Wang <wangyijing@huawei.com>
Cc: Borislav Petkov <bp@alien8.de>
Link: http://lkml.kernel.org/r/1436428847-8886-6-git-send-email-jiang.liu@linux.intel.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
parent df516f42
...@@ -179,7 +179,7 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) ...@@ -179,7 +179,7 @@ static int xen_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
if (ret) if (ret)
goto error; goto error;
i = 0; i = 0;
list_for_each_entry(msidesc, &dev->msi_list, list) { for_each_pci_msi_entry(msidesc, dev) {
irq = xen_bind_pirq_msi_to_irq(dev, msidesc, v[i], irq = xen_bind_pirq_msi_to_irq(dev, msidesc, v[i],
(type == PCI_CAP_ID_MSI) ? nvec : 1, (type == PCI_CAP_ID_MSI) ? nvec : 1,
(type == PCI_CAP_ID_MSIX) ? (type == PCI_CAP_ID_MSIX) ?
...@@ -230,7 +230,7 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) ...@@ -230,7 +230,7 @@ static int xen_hvm_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
if (type == PCI_CAP_ID_MSI && nvec > 1) if (type == PCI_CAP_ID_MSI && nvec > 1)
return 1; return 1;
list_for_each_entry(msidesc, &dev->msi_list, list) { for_each_pci_msi_entry(msidesc, dev) {
__pci_read_msi_msg(msidesc, &msg); __pci_read_msi_msg(msidesc, &msg);
pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) | pirq = MSI_ADDR_EXT_DEST_ID(msg.address_hi) |
((msg.address_lo >> MSI_ADDR_DEST_ID_SHIFT) & 0xff); ((msg.address_lo >> MSI_ADDR_DEST_ID_SHIFT) & 0xff);
...@@ -274,7 +274,7 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) ...@@ -274,7 +274,7 @@ static int xen_initdom_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
int ret = 0; int ret = 0;
struct msi_desc *msidesc; struct msi_desc *msidesc;
list_for_each_entry(msidesc, &dev->msi_list, list) { for_each_pci_msi_entry(msidesc, dev) {
struct physdev_map_pirq map_irq; struct physdev_map_pirq map_irq;
domid_t domid; domid_t domid;
...@@ -386,7 +386,7 @@ static void xen_teardown_msi_irqs(struct pci_dev *dev) ...@@ -386,7 +386,7 @@ static void xen_teardown_msi_irqs(struct pci_dev *dev)
{ {
struct msi_desc *msidesc; struct msi_desc *msidesc;
msidesc = list_entry(dev->msi_list.next, struct msi_desc, list); msidesc = first_pci_msi_entry(dev);
if (msidesc->msi_attrib.is_msix) if (msidesc->msi_attrib.is_msix)
xen_pci_frontend_disable_msix(dev); xen_pci_frontend_disable_msix(dev);
else else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment