提交 262a2baf 编写于 作者: Y Yijing Wang 提交者: Bjorn Helgaas

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: NBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: NYijing Wang <wangyijing@huawei.com>
Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
上级 c2791b80
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册