Skip to content

Commit 7c0dbd8

Browse files
committed
irqchip/sg2042-msi: 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> Reviewed-by: Chen Wang <unicorn_wang@outlook.com> Link: https://lore.kernel.org/all/3e901db1a4c87678af053019774d95b73bfb9ef9.1750860131.git.namcao@linutronix.de
1 parent 7f91d60 commit 7c0dbd8

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

drivers/irqchip/irq-sg2042-msi.c

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -219,20 +219,18 @@ static const struct msi_parent_ops sg2044_msi_parent_ops = {
219219
static int sg204x_msi_init_domains(struct sg204x_msi_chipdata *data,
220220
struct irq_domain *plic_domain, struct device *dev)
221221
{
222-
struct fwnode_handle *fwnode = dev_fwnode(dev);
223-
struct irq_domain *middle_domain;
224-
225-
middle_domain = irq_domain_create_hierarchy(plic_domain, 0, data->num_irqs, fwnode,
226-
&sg204x_msi_middle_domain_ops, data);
227-
if (!middle_domain) {
222+
struct irq_domain_info info = {
223+
.ops = &sg204x_msi_middle_domain_ops,
224+
.parent = plic_domain,
225+
.size = data->num_irqs,
226+
.fwnode = dev_fwnode(dev),
227+
.host_data = data,
228+
};
229+
230+
if (!msi_create_parent_irq_domain(&info, data->chip_info->parent_ops)) {
228231
pr_err("Failed to create the MSI middle domain\n");
229232
return -ENOMEM;
230233
}
231-
232-
irq_domain_update_bus_token(middle_domain, DOMAIN_BUS_NEXUS);
233-
234-
middle_domain->flags |= IRQ_DOMAIN_FLAG_MSI_PARENT;
235-
middle_domain->msi_parent_ops = data->chip_info->parent_ops;
236234
return 0;
237235
}
238236

0 commit comments

Comments
 (0)