Skip to content

Commit 2ada5ed

Browse files
hcodinaKAGA-KOKO
authored andcommitted
irqdomain: Convert domain creation functions to irq_domain_instantiate()
Domain creation functions use __irq_domain_add(). With the introduction of irq_domain_instantiate(), __irq_domain_add() becomes obsolete. In order to fully remove __irq_domain_add(), convert domain creation function to irq_domain_instantiate() Signed-off-by: Herve Codina <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 7c53626 commit 2ada5ed

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

kernel/irq/irqdomain.c

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -442,10 +442,17 @@ struct irq_domain *irq_domain_create_simple(struct fwnode_handle *fwnode,
442442
const struct irq_domain_ops *ops,
443443
void *host_data)
444444
{
445+
struct irq_domain_info info = {
446+
.fwnode = fwnode,
447+
.size = size,
448+
.hwirq_max = size,
449+
.ops = ops,
450+
.host_data = host_data,
451+
};
445452
struct irq_domain *domain;
446453

447-
domain = __irq_domain_add(fwnode, size, size, 0, ops, host_data);
448-
if (!domain)
454+
domain = irq_domain_instantiate(&info);
455+
if (IS_ERR(domain))
449456
return NULL;
450457

451458
if (first_irq > 0) {
@@ -498,11 +505,20 @@ struct irq_domain *irq_domain_create_legacy(struct fwnode_handle *fwnode,
498505
const struct irq_domain_ops *ops,
499506
void *host_data)
500507
{
508+
struct irq_domain_info info = {
509+
.fwnode = fwnode,
510+
.size = first_hwirq + size,
511+
.hwirq_max = first_hwirq + size,
512+
.ops = ops,
513+
.host_data = host_data,
514+
};
501515
struct irq_domain *domain;
502516

503-
domain = __irq_domain_add(fwnode, first_hwirq + size, first_hwirq + size, 0, ops, host_data);
504-
if (domain)
505-
irq_domain_associate_many(domain, first_irq, first_hwirq, size);
517+
domain = irq_domain_instantiate(&info);
518+
if (IS_ERR(domain))
519+
return NULL;
520+
521+
irq_domain_associate_many(domain, first_irq, first_hwirq, size);
506522

507523
return domain;
508524
}

0 commit comments

Comments
 (0)