Skip to content

Commit a701f8e

Browse files
hcodinaKAGA-KOKO
authored andcommitted
_PATCH_19_23_um_virt_pci_Use_irq_domain_instantiate_
um_pci_init() uses __irq_domain_add(). With the introduction of irq_domain_instantiate(), __irq_domain_add() becomes obsolete. In order to fully remove __irq_domain_add(), use directly irq_domain_instantiate(). [ tglx: Fixup struct initializer ] Signed-off-by: Herve Codina <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 2ada5ed commit a701f8e

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

arch/um/drivers/virt-pci.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -986,6 +986,11 @@ static struct resource virt_platform_resource = {
986986

987987
static int __init um_pci_init(void)
988988
{
989+
struct irq_domain_info inner_domain_info = {
990+
.size = MAX_MSI_VECTORS,
991+
.hwirq_max = MAX_MSI_VECTORS,
992+
.ops = &um_pci_inner_domain_ops,
993+
};
989994
int err, i;
990995

991996
WARN_ON(logic_iomem_add_region(&virt_cfgspace_resource,
@@ -1015,11 +1020,10 @@ static int __init um_pci_init(void)
10151020
goto free;
10161021
}
10171022

1018-
um_pci_inner_domain = __irq_domain_add(um_pci_fwnode, MAX_MSI_VECTORS,
1019-
MAX_MSI_VECTORS, 0,
1020-
&um_pci_inner_domain_ops, NULL);
1021-
if (!um_pci_inner_domain) {
1022-
err = -ENOMEM;
1023+
inner_domain_info.fwnode = um_pci_fwnode;
1024+
um_pci_inner_domain = irq_domain_instantiate(&inner_domain_info);
1025+
if (IS_ERR(um_pci_inner_domain)) {
1026+
err = PTR_ERR(um_pci_inner_domain);
10231027
goto free;
10241028
}
10251029

@@ -1056,7 +1060,7 @@ static int __init um_pci_init(void)
10561060
goto free;
10571061
return 0;
10581062
free:
1059-
if (um_pci_inner_domain)
1063+
if (!IS_ERR_OR_NULL(um_pci_inner_domain))
10601064
irq_domain_remove(um_pci_inner_domain);
10611065
if (um_pci_fwnode)
10621066
irq_domain_free_fwnode(um_pci_fwnode);

0 commit comments

Comments
 (0)