summaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel/msi.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/msi.c')
-rw-r--r--arch/powerpc/kernel/msi.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c
index 71bd161640cf..3d452f71fa25 100644
--- a/arch/powerpc/kernel/msi.c
+++ b/arch/powerpc/kernel/msi.c
@@ -15,7 +15,11 @@
int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
{
- if (!ppc_md.setup_msi_irqs || !ppc_md.teardown_msi_irqs) {
+ struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
+ if ((!phb->controller_ops.setup_msi_irqs ||
+ !phb->controller_ops.teardown_msi_irqs) &&
+ (!ppc_md.setup_msi_irqs || !ppc_md.teardown_msi_irqs)) {
pr_debug("msi: Platform doesn't provide MSI callbacks.\n");
return -ENOSYS;
}
@@ -24,10 +28,18 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
if (type == PCI_CAP_ID_MSI && nvec > 1)
return 1;
- return ppc_md.setup_msi_irqs(dev, nvec, type);
+ if (phb->controller_ops.setup_msi_irqs)
+ return phb->controller_ops.setup_msi_irqs(dev, nvec, type);
+ else
+ return ppc_md.setup_msi_irqs(dev, nvec, type);
}
void arch_teardown_msi_irqs(struct pci_dev *dev)
{
- ppc_md.teardown_msi_irqs(dev);
+ struct pci_controller *phb = pci_bus_to_host(dev->bus);
+
+ if (phb->controller_ops.teardown_msi_irqs)
+ phb->controller_ops.teardown_msi_irqs(dev);
+ else
+ ppc_md.teardown_msi_irqs(dev);
}