Skip to content

Commit 7f91d60

Browse files
committed
irqchip/loongson-pch-msi.c: Switch to msi_create_parent_irq_domain()
Switch to use the concise helper to create an MSI parent domain. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Nam Cao <namcao@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Link: https://lore.kernel.org/all/7ae78d7b7e33ad8ca1ec2ba28957546c81ba86f7.1750860131.git.namcao@linutronix.de
1 parent c7cc7b1 commit 7f91d60

1 file changed

Lines changed: 10 additions & 15 deletions

File tree

drivers/irqchip/irq-loongson-pch-msi.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -153,26 +153,21 @@ static struct msi_parent_ops pch_msi_parent_ops = {
153153
.init_dev_msi_info = msi_lib_init_dev_msi_info,
154154
};
155155

156-
static int pch_msi_init_domains(struct pch_msi_data *priv,
157-
struct irq_domain *parent,
156+
static int pch_msi_init_domains(struct pch_msi_data *priv, struct irq_domain *parent,
158157
struct fwnode_handle *domain_handle)
159158
{
160-
struct irq_domain *middle_domain;
161-
162-
middle_domain = irq_domain_create_hierarchy(parent, 0, priv->num_irqs,
163-
domain_handle,
164-
&pch_msi_middle_domain_ops,
165-
priv);
166-
if (!middle_domain) {
159+
struct irq_domain_info info = {
160+
.ops = &pch_msi_middle_domain_ops,
161+
.size = priv->num_irqs,
162+
.parent = parent,
163+
.host_data = priv,
164+
.fwnode = domain_handle,
165+
};
166+
167+
if (!msi_create_parent_irq_domain(&info, &pch_msi_parent_ops)) {
167168
pr_err("Failed to create the MSI middle domain\n");
168169
return -ENOMEM;
169170
}
170-
171-
irq_domain_update_bus_token(middle_domain, DOMAIN_BUS_NEXUS);
172-
173-
middle_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT;
174-
middle_domain->msi_parent_ops = &pch_msi_parent_ops;
175-
176171
return 0;
177172
}
178173

0 commit comments

Comments
 (0)