e388bc2ea78ecba7ce7daf3818a4cea5f521d661
[openwrt/staging/mkresin.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 diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
19 index c7bd6b123857..b5e5c922ad0d 100644
20 --- a/drivers/pci/controller/pci-aardvark.c
21 +++ b/drivers/pci/controller/pci-aardvark.c
22 @@ -281,7 +281,6 @@ struct advk_pcie {
23 raw_spinlock_t irq_lock;
24 struct irq_domain *msi_domain;
25 struct irq_domain *msi_inner_domain;
26 - struct msi_domain_info msi_domain_info;
27 DECLARE_BITMAP(msi_used, MSI_IRQ_NUM);
28 struct mutex msi_used_lock;
29 u16 msi_msg;
30 @@ -1291,20 +1290,20 @@ static struct irq_chip advk_msi_irq_chip = {
31 .name = "advk-MSI",
32 };
33
34 +static struct msi_domain_info advk_msi_domain_info = {
35 + .flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
36 + MSI_FLAG_MULTI_PCI_MSI,
37 + .chip = &advk_msi_irq_chip,
38 +};
39 +
40 static int advk_pcie_init_msi_irq_domain(struct advk_pcie *pcie)
41 {
42 struct device *dev = &pcie->pdev->dev;
43 struct device_node *node = dev->of_node;
44 - struct msi_domain_info *msi_di;
45 phys_addr_t msi_msg_phys;
46
47 mutex_init(&pcie->msi_used_lock);
48
49 - msi_di = &pcie->msi_domain_info;
50 - msi_di->flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
51 - MSI_FLAG_MULTI_PCI_MSI;
52 - msi_di->chip = &advk_msi_irq_chip;
53 -
54 msi_msg_phys = virt_to_phys(&pcie->msi_msg);
55
56 advk_writel(pcie, lower_32_bits(msi_msg_phys),
57 @@ -1320,7 +1319,8 @@ static int advk_pcie_init_msi_irq_domain(struct advk_pcie *pcie)
58
59 pcie->msi_domain =
60 pci_msi_create_irq_domain(of_node_to_fwnode(node),
61 - msi_di, pcie->msi_inner_domain);
62 + &advk_msi_domain_info,
63 + pcie->msi_inner_domain);
64 if (!pcie->msi_domain) {
65 irq_domain_remove(pcie->msi_inner_domain);
66 return -ENOMEM;
67 --
68 2.34.1
69