2f15b5b8d6bacd57061fed96245d8718873b4082
[openwrt/staging/dedeckeh.git] /
1 From c092ab8994f1f777054c0179a9deb40b87ee606f Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Marek=20Beh=C3=BAn?= <kabel@kernel.org>
3 Date: Mon, 10 Jan 2022 00:10:46 +0100
4 Subject: [PATCH] PCI: aardvark: Make msi_domain_info structure a static driver
5 structure
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Make Aardvark's msi_domain_info structure into a private driver structure.
11 Domain info is same for every potential instatination of a controller.
12
13 Signed-off-by: Marek BehĂșn <kabel@kernel.org>
14 ---
15 drivers/pci/controller/pci-aardvark.c | 16 ++++++++--------
16 1 file changed, 8 insertions(+), 8 deletions(-)
17
18 --- a/drivers/pci/controller/pci-aardvark.c
19 +++ b/drivers/pci/controller/pci-aardvark.c
20 @@ -281,7 +281,6 @@ struct advk_pcie {
21 raw_spinlock_t irq_lock;
22 struct irq_domain *msi_domain;
23 struct irq_domain *msi_inner_domain;
24 - struct msi_domain_info msi_domain_info;
25 DECLARE_BITMAP(msi_used, MSI_IRQ_NUM);
26 struct mutex msi_used_lock;
27 u16 msi_msg;
28 @@ -1293,20 +1292,20 @@ static struct irq_chip advk_msi_irq_chip
29 .name = "advk-MSI",
30 };
31
32 +static struct msi_domain_info advk_msi_domain_info = {
33 + .flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
34 + MSI_FLAG_MULTI_PCI_MSI,
35 + .chip = &advk_msi_irq_chip,
36 +};
37 +
38 static int advk_pcie_init_msi_irq_domain(struct advk_pcie *pcie)
39 {
40 struct device *dev = &pcie->pdev->dev;
41 struct device_node *node = dev->of_node;
42 - struct msi_domain_info *msi_di;
43 phys_addr_t msi_msg_phys;
44
45 mutex_init(&pcie->msi_used_lock);
46
47 - msi_di = &pcie->msi_domain_info;
48 - msi_di->flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
49 - MSI_FLAG_MULTI_PCI_MSI;
50 - msi_di->chip = &advk_msi_irq_chip;
51 -
52 msi_msg_phys = virt_to_phys(&pcie->msi_msg);
53
54 advk_writel(pcie, lower_32_bits(msi_msg_phys),
55 @@ -1322,7 +1321,8 @@ static int advk_pcie_init_msi_irq_domain
56
57 pcie->msi_domain =
58 pci_msi_create_irq_domain(of_node_to_fwnode(node),
59 - msi_di, pcie->msi_inner_domain);
60 + &advk_msi_domain_info,
61 + pcie->msi_inner_domain);
62 if (!pcie->msi_domain) {
63 irq_domain_remove(pcie->msi_inner_domain);
64 return -ENOMEM;