Skip to content

Commit c3cb8e5

Browse files
elkabloLorenzo Pieralisi
authored andcommitted
PCI: aardvark: Make MSI irq_chip structures static driver structures
In [1] it was agreed that we should use struct irq_chip as a global static struct in the driver. Even though the structure currently contains a dynamic member (parent_device), In [2] the plans to kill it and make the structure completely static were set out. Convert Aardvark's priv->msi_bottom_irq_chip and priv->msi_irq_chip to static driver structure. [1] https://lore.kernel.org/linux-pci/877dbcvngf.wl-maz@kernel.org/ [2] https://lore.kernel.org/linux-pci/874k6gvkhz.wl-maz@kernel.org/ Link: https://lore.kernel.org/r/20220110015018.26359-7-kabel@kernel.org Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
1 parent 51f96e2 commit c3cb8e5

1 file changed

Lines changed: 12 additions & 14 deletions

File tree

drivers/pci/controller/pci-aardvark.c

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -274,8 +274,6 @@ struct advk_pcie {
274274
raw_spinlock_t irq_lock;
275275
struct irq_domain *msi_domain;
276276
struct irq_domain *msi_inner_domain;
277-
struct irq_chip msi_bottom_irq_chip;
278-
struct irq_chip msi_irq_chip;
279277
struct msi_domain_info msi_domain_info;
280278
DECLARE_BITMAP(msi_used, MSI_IRQ_NUM);
281279
struct mutex msi_used_lock;
@@ -1190,6 +1188,12 @@ static int advk_msi_set_affinity(struct irq_data *irq_data,
11901188
return -EINVAL;
11911189
}
11921190

1191+
static struct irq_chip advk_msi_bottom_irq_chip = {
1192+
.name = "MSI",
1193+
.irq_compose_msi_msg = advk_msi_irq_compose_msi_msg,
1194+
.irq_set_affinity = advk_msi_set_affinity,
1195+
};
1196+
11931197
static int advk_msi_irq_domain_alloc(struct irq_domain *domain,
11941198
unsigned int virq,
11951199
unsigned int nr_irqs, void *args)
@@ -1206,7 +1210,7 @@ static int advk_msi_irq_domain_alloc(struct irq_domain *domain,
12061210

12071211
for (i = 0; i < nr_irqs; i++)
12081212
irq_domain_set_info(domain, virq + i, hwirq + i,
1209-
&pcie->msi_bottom_irq_chip,
1213+
&advk_msi_bottom_irq_chip,
12101214
domain->host_data, handle_simple_irq,
12111215
NULL, NULL);
12121216

@@ -1276,29 +1280,23 @@ static const struct irq_domain_ops advk_pcie_irq_domain_ops = {
12761280
.xlate = irq_domain_xlate_onecell,
12771281
};
12781282

1283+
static struct irq_chip advk_msi_irq_chip = {
1284+
.name = "advk-MSI",
1285+
};
1286+
12791287
static int advk_pcie_init_msi_irq_domain(struct advk_pcie *pcie)
12801288
{
12811289
struct device *dev = &pcie->pdev->dev;
12821290
struct device_node *node = dev->of_node;
1283-
struct irq_chip *bottom_ic, *msi_ic;
12841291
struct msi_domain_info *msi_di;
12851292
phys_addr_t msi_msg_phys;
12861293

12871294
mutex_init(&pcie->msi_used_lock);
12881295

1289-
bottom_ic = &pcie->msi_bottom_irq_chip;
1290-
1291-
bottom_ic->name = "MSI";
1292-
bottom_ic->irq_compose_msi_msg = advk_msi_irq_compose_msi_msg;
1293-
bottom_ic->irq_set_affinity = advk_msi_set_affinity;
1294-
1295-
msi_ic = &pcie->msi_irq_chip;
1296-
msi_ic->name = "advk-MSI";
1297-
12981296
msi_di = &pcie->msi_domain_info;
12991297
msi_di->flags = MSI_FLAG_USE_DEF_DOM_OPS | MSI_FLAG_USE_DEF_CHIP_OPS |
13001298
MSI_FLAG_MULTI_PCI_MSI;
1301-
msi_di->chip = msi_ic;
1299+
msi_di->chip = &advk_msi_irq_chip;
13021300

13031301
msi_msg_phys = virt_to_phys(&pcie->msi_msg);
13041302

0 commit comments

Comments
 (0)