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>
This commit is contained in:

committed by
Bjorn Helgaas

parent
52addcf9d6
commit
6b2fd7efeb
@@ -46,29 +46,21 @@
|
||||
//#define cfg_dbg(fmt...) printk(fmt)
|
||||
|
||||
#ifdef CONFIG_PCI_MSI
|
||||
static int pnv_msi_check_device(struct pci_dev* pdev, int nvec, int type)
|
||||
{
|
||||
struct pci_controller *hose = pci_bus_to_host(pdev->bus);
|
||||
struct pnv_phb *phb = hose->private_data;
|
||||
struct pci_dn *pdn = pci_get_pdn(pdev);
|
||||
|
||||
if (pdn && pdn->force_32bit_msi && !phb->msi32_support)
|
||||
return -ENODEV;
|
||||
|
||||
return (phb && phb->msi_bmp.bitmap) ? 0 : -ENODEV;
|
||||
}
|
||||
|
||||
static int pnv_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
|
||||
{
|
||||
struct pci_controller *hose = pci_bus_to_host(pdev->bus);
|
||||
struct pnv_phb *phb = hose->private_data;
|
||||
struct pci_dn *pdn = pci_get_pdn(pdev);
|
||||
struct msi_desc *entry;
|
||||
struct msi_msg msg;
|
||||
int hwirq;
|
||||
unsigned int virq;
|
||||
int rc;
|
||||
|
||||
if (WARN_ON(!phb))
|
||||
if (WARN_ON(!phb) || !phb->msi_bmp.bitmap)
|
||||
return -ENODEV;
|
||||
|
||||
if (pdn && pdn->force_32bit_msi && !phb->msi32_support)
|
||||
return -ENODEV;
|
||||
|
||||
list_for_each_entry(entry, &pdev->msi_list, list) {
|
||||
@@ -860,7 +852,6 @@ void __init pnv_pci_init(void)
|
||||
|
||||
/* Configure MSIs */
|
||||
#ifdef CONFIG_PCI_MSI
|
||||
ppc_md.msi_check_device = pnv_msi_check_device;
|
||||
ppc_md.setup_msi_irqs = pnv_setup_msi_irqs;
|
||||
ppc_md.teardown_msi_irqs = pnv_teardown_msi_irqs;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user