Skip to content

Commit a80c0ac

Browse files
committed
genirq/msi: Split msi_create_irq_domain()
Split the functionality of msi_create_irq_domain() so it can be reused for creating per device irq domains. No functional change. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Kevin Tian <kevin.tian@intel.com> Acked-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20221124232325.559086358@linutronix.de
1 parent 61bf992 commit a80c0ac

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

kernel/irq/msi.c

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -758,17 +758,10 @@ static void msi_domain_update_chip_ops(struct msi_domain_info *info)
758758
chip->irq_set_affinity = msi_domain_set_affinity;
759759
}
760760

761-
/**
762-
* msi_create_irq_domain - Create an MSI interrupt domain
763-
* @fwnode: Optional fwnode of the interrupt controller
764-
* @info: MSI domain info
765-
* @parent: Parent irq domain
766-
*
767-
* Return: pointer to the created &struct irq_domain or %NULL on failure
768-
*/
769-
struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode,
770-
struct msi_domain_info *info,
771-
struct irq_domain *parent)
761+
static struct irq_domain *__msi_create_irq_domain(struct fwnode_handle *fwnode,
762+
struct msi_domain_info *info,
763+
unsigned int flags,
764+
struct irq_domain *parent)
772765
{
773766
struct irq_domain *domain;
774767

@@ -787,7 +780,7 @@ struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode,
787780
if (info->flags & MSI_FLAG_USE_DEF_CHIP_OPS)
788781
msi_domain_update_chip_ops(info);
789782

790-
domain = irq_domain_create_hierarchy(parent, IRQ_DOMAIN_FLAG_MSI, 0,
783+
domain = irq_domain_create_hierarchy(parent, flags | IRQ_DOMAIN_FLAG_MSI, 0,
791784
fwnode, &msi_domain_ops, info);
792785

793786
if (domain) {
@@ -799,6 +792,21 @@ struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode,
799792
return domain;
800793
}
801794

795+
/**
796+
* msi_create_irq_domain - Create an MSI interrupt domain
797+
* @fwnode: Optional fwnode of the interrupt controller
798+
* @info: MSI domain info
799+
* @parent: Parent irq domain
800+
*
801+
* Return: pointer to the created &struct irq_domain or %NULL on failure
802+
*/
803+
struct irq_domain *msi_create_irq_domain(struct fwnode_handle *fwnode,
804+
struct msi_domain_info *info,
805+
struct irq_domain *parent)
806+
{
807+
return __msi_create_irq_domain(fwnode, info, 0, parent);
808+
}
809+
802810
/**
803811
* msi_parent_init_dev_msi_info - Delegate initialization of device MSI info down
804812
* in the domain hierarchy

0 commit comments

Comments
 (0)