aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/powernv/pci.c
diff options
context:
space:
mode:
authorAlexander Gordeev <agordeev@redhat.com>2014-09-07 14:57:53 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-10-01 14:21:14 -0400
commit6b2fd7efeb888fa781c1f767de6c36497ac1596b (patch)
tree5c0034e0cd1db2e36e54140a6f1477948016bc0f /arch/powerpc/platforms/powernv/pci.c
parent52addcf9d6669fa439387610bc65c92fa0980cef (diff)
PCI/MSI/PPC: Remove arch_msi_check_device()
Move MSI checks from arch_msi_check_device() to arch_setup_msi_irqs(). This makes the code more compact and allows removing arch_msi_check_device() from generic MSI code. Signed-off-by: Alexander Gordeev <agordeev@redhat.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/platforms/powernv/pci.c')
-rw-r--r--arch/powerpc/platforms/powernv/pci.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c
index b854b57ed5e1..b45c49249a5d 100644
--- a/arch/powerpc/platforms/powernv/pci.c
+++ b/arch/powerpc/platforms/powernv/pci.c
@@ -46,29 +46,21 @@
46//#define cfg_dbg(fmt...) printk(fmt) 46//#define cfg_dbg(fmt...) printk(fmt)
47 47
48#ifdef CONFIG_PCI_MSI 48#ifdef CONFIG_PCI_MSI
49static int pnv_msi_check_device(struct pci_dev* pdev, int nvec, int type)
50{
51 struct pci_controller *hose = pci_bus_to_host(pdev->bus);
52 struct pnv_phb *phb = hose->private_data;
53 struct pci_dn *pdn = pci_get_pdn(pdev);
54
55 if (pdn && pdn->force_32bit_msi && !phb->msi32_support)
56 return -ENODEV;
57
58 return (phb && phb->msi_bmp.bitmap) ? 0 : -ENODEV;
59}
60
61static int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type) 49static int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
62{ 50{
63 struct pci_controller *hose = pci_bus_to_host(pdev->bus); 51 struct pci_controller *hose = pci_bus_to_host(pdev->bus);
64 struct pnv_phb *phb = hose->private_data; 52 struct pnv_phb *phb = hose->private_data;
53 struct pci_dn *pdn = pci_get_pdn(pdev);
65 struct msi_desc *entry; 54 struct msi_desc *entry;
66 struct msi_msg msg; 55 struct msi_msg msg;
67 int hwirq; 56 int hwirq;
68 unsigned int virq; 57 unsigned int virq;
69 int rc; 58 int rc;
70 59
71 if (WARN_ON(!phb)) 60 if (WARN_ON(!phb) || !phb->msi_bmp.bitmap)
61 return -ENODEV;
62
63 if (pdn && pdn->force_32bit_msi && !phb->msi32_support)
72 return -ENODEV; 64 return -ENODEV;
73 65
74 list_for_each_entry(entry, &pdev->msi_list, list) { 66 list_for_each_entry(entry, &pdev->msi_list, list) {
@@ -860,7 +852,6 @@ void __init pnv_pci_init(void)
860 852
861 /* Configure MSIs */ 853 /* Configure MSIs */
862#ifdef CONFIG_PCI_MSI 854#ifdef CONFIG_PCI_MSI
863 ppc_md.msi_check_device = pnv_msi_check_device;
864 ppc_md.setup_msi_irqs = pnv_setup_msi_irqs; 855 ppc_md.setup_msi_irqs = pnv_setup_msi_irqs;
865 ppc_md.teardown_msi_irqs = pnv_teardown_msi_irqs; 856 ppc_md.teardown_msi_irqs = pnv_teardown_msi_irqs;
866#endif 857#endif