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) <jirislaby@kernel.org> Cc: Richard Weinberger <richard@nod.at> Cc: Anton Ivanov <anton.ivanov@cambridgegreys.com> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: linux-um@lists.infradead.org Link: https://patch.msgid.link/20250415104713.106819-1-jirislaby@kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
committed by
Johannes Berg
parent
a0e2cb6a90
commit
7633b8b1e7
@@ -538,11 +538,6 @@ void um_pci_platform_device_unregister(struct um_pci_device *dev)
|
|||||||
|
|
||||||
static int __init um_pci_init(void)
|
static int __init um_pci_init(void)
|
||||||
{
|
{
|
||||||
struct irq_domain_info inner_domain_info = {
|
|
||||||
.size = MAX_MSI_VECTORS,
|
|
||||||
.hwirq_max = MAX_MSI_VECTORS,
|
|
||||||
.ops = &um_pci_inner_domain_ops,
|
|
||||||
};
|
|
||||||
int err, i;
|
int err, i;
|
||||||
|
|
||||||
WARN_ON(logic_iomem_add_region(&virt_cfgspace_resource,
|
WARN_ON(logic_iomem_add_region(&virt_cfgspace_resource,
|
||||||
@@ -564,10 +559,10 @@ static int __init um_pci_init(void)
|
|||||||
goto free;
|
goto free;
|
||||||
}
|
}
|
||||||
|
|
||||||
inner_domain_info.fwnode = um_pci_fwnode;
|
um_pci_inner_domain = irq_domain_create_linear(um_pci_fwnode, MAX_MSI_VECTORS,
|
||||||
um_pci_inner_domain = irq_domain_instantiate(&inner_domain_info);
|
&um_pci_inner_domain_ops, NULL);
|
||||||
if (IS_ERR(um_pci_inner_domain)) {
|
if (!um_pci_inner_domain) {
|
||||||
err = PTR_ERR(um_pci_inner_domain);
|
err = -ENOMEM;
|
||||||
goto free;
|
goto free;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,7 +597,7 @@ static int __init um_pci_init(void)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
free:
|
free:
|
||||||
if (!IS_ERR_OR_NULL(um_pci_inner_domain))
|
if (um_pci_inner_domain)
|
||||||
irq_domain_remove(um_pci_inner_domain);
|
irq_domain_remove(um_pci_inner_domain);
|
||||||
if (um_pci_fwnode)
|
if (um_pci_fwnode)
|
||||||
irq_domain_free_fwnode(um_pci_fwnode);
|
irq_domain_free_fwnode(um_pci_fwnode);
|
||||||
|
|||||||
Reference in New Issue
Block a user