Skip to content

Commit 7c53626

Browse files
hcodinaKAGA-KOKO
authored andcommitted
irqdomain: Convert __irq_domain_add() wrappers to irq_domain_instantiate()
__irq_domain_add() wrappers use directly __irq_domain_add(). With the introduction of irq_domain_instantiate(), __irq_domain_add() becomes obsolete. In order to fully remove __irq_domain_add(), convert wrappers to irq_domain_instantiate() [ tglx: Fixup struct initializers ] Signed-off-by: Herve Codina <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 0c5b29a commit 7c53626

File tree

1 file changed

+53
-5
lines changed

1 file changed

+53
-5
lines changed

include/linux/irqdomain.h

Lines changed: 53 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,17 @@ static inline struct irq_domain *irq_domain_add_linear(struct device_node *of_no
400400
const struct irq_domain_ops *ops,
401401
void *host_data)
402402
{
403-
return __irq_domain_add(of_node_to_fwnode(of_node), size, size, 0, ops, host_data);
403+
struct irq_domain_info info = {
404+
.fwnode = of_node_to_fwnode(of_node),
405+
.size = size,
406+
.hwirq_max = size,
407+
.ops = ops,
408+
.host_data = host_data,
409+
};
410+
struct irq_domain *d;
411+
412+
d = irq_domain_instantiate(&info);
413+
return IS_ERR(d) ? NULL : d;
404414
}
405415

406416
#ifdef CONFIG_IRQ_DOMAIN_NOMAP
@@ -409,7 +419,17 @@ static inline struct irq_domain *irq_domain_add_nomap(struct device_node *of_nod
409419
const struct irq_domain_ops *ops,
410420
void *host_data)
411421
{
412-
return __irq_domain_add(of_node_to_fwnode(of_node), 0, max_irq, max_irq, ops, host_data);
422+
struct irq_domain_info info = {
423+
.fwnode = of_node_to_fwnode(of_node),
424+
.hwirq_max = max_irq,
425+
.direct_max = max_irq,
426+
.ops = ops,
427+
.host_data = host_data,
428+
};
429+
struct irq_domain *d;
430+
431+
d = irq_domain_instantiate(&info);
432+
return IS_ERR(d) ? NULL : d;
413433
}
414434

415435
extern unsigned int irq_create_direct_mapping(struct irq_domain *host);
@@ -419,22 +439,50 @@ static inline struct irq_domain *irq_domain_add_tree(struct device_node *of_node
419439
const struct irq_domain_ops *ops,
420440
void *host_data)
421441
{
422-
return __irq_domain_add(of_node_to_fwnode(of_node), 0, ~0, 0, ops, host_data);
442+
struct irq_domain_info info = {
443+
.fwnode = of_node_to_fwnode(of_node),
444+
.hwirq_max = ~0U,
445+
.ops = ops,
446+
.host_data = host_data,
447+
};
448+
struct irq_domain *d;
449+
450+
d = irq_domain_instantiate(&info);
451+
return IS_ERR(d) ? NULL : d;
423452
}
424453

425454
static inline struct irq_domain *irq_domain_create_linear(struct fwnode_handle *fwnode,
426455
unsigned int size,
427456
const struct irq_domain_ops *ops,
428457
void *host_data)
429458
{
430-
return __irq_domain_add(fwnode, size, size, 0, ops, host_data);
459+
struct irq_domain_info info = {
460+
.fwnode = fwnode,
461+
.size = size,
462+
.hwirq_max = size,
463+
.ops = ops,
464+
.host_data = host_data,
465+
};
466+
struct irq_domain *d;
467+
468+
d = irq_domain_instantiate(&info);
469+
return IS_ERR(d) ? NULL : d;
431470
}
432471

433472
static inline struct irq_domain *irq_domain_create_tree(struct fwnode_handle *fwnode,
434473
const struct irq_domain_ops *ops,
435474
void *host_data)
436475
{
437-
return __irq_domain_add(fwnode, 0, ~0, 0, ops, host_data);
476+
struct irq_domain_info info = {
477+
.fwnode = fwnode,
478+
.hwirq_max = ~0,
479+
.ops = ops,
480+
.host_data = host_data,
481+
};
482+
struct irq_domain *d;
483+
484+
d = irq_domain_instantiate(&info);
485+
return IS_ERR(d) ? NULL : d;
438486
}
439487

440488
extern void irq_domain_remove(struct irq_domain *host);

0 commit comments

Comments
 (0)