Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fa1152f authored by Yijing Wang's avatar Yijing Wang Committed by Alex Shi
Browse files

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: default avatarBjorn Helgaas <bhelgaas@google.com>
Signed-off-by: default avatarYijing Wang <wangyijing@huawei.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
(cherry picked from commit 262a2baf9e4a2fcedb6645ca98d77a1c12303a1d)

Signed-off-by: default avatarAlex Shi <alex.shi@linaro.org>
parent e5cf1528
Loading
Loading
Loading
Loading
+16 −1
Original line number Diff line number Diff line
@@ -29,9 +29,24 @@ static int pci_msi_enable = 1;

/* 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)