Commit-ID: 262a2baf9e4a2fcedb6645ca98d77a1c12303a1d Gitweb: http://git.kernel.org/tip/262a2baf9e4a2fcedb6645ca98d77a1c12303a1d Author: Yijing Wang <wangyijing@xxxxxxxxxx> AuthorDate: Tue, 11 Nov 2014 15:22:45 -0700 Committer: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> CommitDate: Wed, 12 Nov 2014 07:56:15 -0700 PCI/MSI: Add weak pcibios_msi_controller() Add pcibios_msi_controller() to get the msi_controller associated with a PCI device. This is to allow arches to store the msi_controller in the arch-specific PCI sysdata. [bhelgaas: changelog, take pci_dev instead of pci_bus] Suggested-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx> Signed-off-by: Yijing Wang <wangyijing@xxxxxxxxxx> Signed-off-by: Bjorn Helgaas <bhelgaas@xxxxxxxxxx>--- drivers/pci/msi.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 0260f39..6c1c1b9 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c @@ -30,9 +30,24 @@ int pci_msi_ignore_mask; /* Arch hooks */ +struct msi_controller * __weak pcibios_msi_controller(struct pci_dev *dev) +{ + return NULL; +} + +static struct msi_controller *pci_msi_controller(struct pci_dev *dev) +{ + struct msi_controller *msi_ctrl = dev->bus->msi; + + if (msi_ctrl) + return msi_ctrl; + + return pcibios_msi_controller(dev); +} + int __weak arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc) { - struct msi_controller *chip = dev->bus->msi; + struct msi_controller *chip = pci_msi_controller(dev); int err; if (!chip || !chip->setup_irq) -- To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
![]() |