Skip to content

Commit 7633b8b

Browse files
Jiri Slaby (SUSE)jmberg-intel
authored andcommitted
irqdomain: um: use irq_domain_create_linear() helper
um_pci_init() open-codes what the irq_domain_create_linear() helper does already. Use the helper instead of open-coding it. This needs retval checking modification. Signed-off-by: Jiri Slaby (SUSE) <[email protected]> Cc: Richard Weinberger <[email protected]> Cc: Anton Ivanov <[email protected]> Cc: Johannes Berg <[email protected]> Cc: [email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent a0e2cb6 commit 7633b8b

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

arch/um/drivers/virt-pci.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -538,11 +538,6 @@ void um_pci_platform_device_unregister(struct um_pci_device *dev)
538538

539539
static int __init um_pci_init(void)
540540
{
541-
struct irq_domain_info inner_domain_info = {
542-
.size = MAX_MSI_VECTORS,
543-
.hwirq_max = MAX_MSI_VECTORS,
544-
.ops = &um_pci_inner_domain_ops,
545-
};
546541
int err, i;
547542

548543
WARN_ON(logic_iomem_add_region(&virt_cfgspace_resource,
@@ -564,10 +559,10 @@ static int __init um_pci_init(void)
564559
goto free;
565560
}
566561

567-
inner_domain_info.fwnode = um_pci_fwnode;
568-
um_pci_inner_domain = irq_domain_instantiate(&inner_domain_info);
569-
if (IS_ERR(um_pci_inner_domain)) {
570-
err = PTR_ERR(um_pci_inner_domain);
562+
um_pci_inner_domain = irq_domain_create_linear(um_pci_fwnode, MAX_MSI_VECTORS,
563+
&um_pci_inner_domain_ops, NULL);
564+
if (!um_pci_inner_domain) {
565+
err = -ENOMEM;
571566
goto free;
572567
}
573568

@@ -602,7 +597,7 @@ static int __init um_pci_init(void)
602597
return 0;
603598

604599
free:
605-
if (!IS_ERR_OR_NULL(um_pci_inner_domain))
600+
if (um_pci_inner_domain)
606601
irq_domain_remove(um_pci_inner_domain);
607602
if (um_pci_fwnode)
608603
irq_domain_free_fwnode(um_pci_fwnode);

0 commit comments

Comments
 (0)