]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
powerpc: Switch to irq_domain_create_*()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 19 Mar 2025 09:29:25 +0000 (10:29 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 16 May 2025 19:06:11 +0000 (21:06 +0200)
irq_domain_add_*() interfaces are going away as being obsolete now.
Switch to the preferred irq_domain_create_*() ones. Those differ in the
node parameter: They take more generic struct fwnode_handle instead of
struct device_node. Therefore, of_fwnode_handle() is added around the
original parameter.

Note some of the users can likely use dev->fwnode directly instead of
indirect of_fwnode_handle(dev->of_node). But dev->fwnode is not
guaranteed to be set for all, so this has to be investigated on case to
case basis (by people who can actually test with the HW).

[ tglx: Fix up subject prefix ]

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> # For 8xx
Link: https://lore.kernel.org/all/20250319092951.37667-33-jirislaby@kernel.org
21 files changed:
arch/powerpc/platforms/44x/uic.c
arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
arch/powerpc/platforms/52xx/media5200.c
arch/powerpc/platforms/52xx/mpc52xx_gpt.c
arch/powerpc/platforms/52xx/mpc52xx_pic.c
arch/powerpc/platforms/85xx/socrates_fpga_pic.c
arch/powerpc/platforms/8xx/cpm1-ic.c
arch/powerpc/platforms/8xx/pic.c
arch/powerpc/platforms/embedded6xx/flipper-pic.c
arch/powerpc/platforms/embedded6xx/hlwd-pic.c
arch/powerpc/platforms/powermac/pic.c
arch/powerpc/platforms/powernv/opal-irqchip.c
arch/powerpc/sysdev/cpm2_pic.c
arch/powerpc/sysdev/ehv_pic.c
arch/powerpc/sysdev/fsl_msi.c
arch/powerpc/sysdev/ge/ge_pic.c
arch/powerpc/sysdev/i8259.c
arch/powerpc/sysdev/ipic.c
arch/powerpc/sysdev/mpic.c
arch/powerpc/sysdev/tsi108_pci.c
arch/powerpc/sysdev/xive/common.c

index 31f760c2ec5dfd713009a903b366dc1fc272c7c1..481ec25ce78fff976561b6f7e34c4149247d326e 100644 (file)
@@ -254,8 +254,9 @@ static struct uic * __init uic_init_one(struct device_node *node)
        }
        uic->dcrbase = *dcrreg;
 
-       uic->irqhost = irq_domain_add_linear(node, NR_UIC_INTS, &uic_host_ops,
-                                            uic);
+       uic->irqhost = irq_domain_create_linear(of_fwnode_handle(node),
+                                               NR_UIC_INTS, &uic_host_ops,
+                                               uic);
        if (! uic->irqhost)
                return NULL; /* FIXME: panic? */
 
index e995eb30bf096fb2e840b0f74edb51948612f52d..2cf3c62373378a6a30b8a8af14ed09c3f9098fb2 100644 (file)
@@ -188,7 +188,8 @@ mpc5121_ads_cpld_pic_init(void)
 
        cpld_pic_node = of_node_get(np);
 
-       cpld_pic_host = irq_domain_add_linear(np, 16, &cpld_pic_host_ops, NULL);
+       cpld_pic_host = irq_domain_create_linear(of_fwnode_handle(np), 16,
+                                                &cpld_pic_host_ops, NULL);
        if (!cpld_pic_host) {
                printk(KERN_ERR "CPLD PIC: failed to allocate irq host!\n");
                goto end;
index 19626cd42406598a14cb9385efd0bfabcb643180..bc7f83cfec1dc779d5dfd844c72a1b5eeb42e5a0 100644 (file)
@@ -168,7 +168,7 @@ static void __init media5200_init_irq(void)
 
        spin_lock_init(&media5200_irq.lock);
 
-       media5200_irq.irqhost = irq_domain_add_linear(fpga_np,
+       media5200_irq.irqhost = irq_domain_create_linear(of_fwnode_handle(fpga_np),
                        MEDIA5200_NUM_IRQS, &media5200_irq_ops, &media5200_irq);
        if (!media5200_irq.irqhost)
                goto out;
index 1ea591ec608334ba549748c0b6ffbe1b83707c5e..f042b21b2b732cc15840443ab273757fdebb3e94 100644 (file)
@@ -247,9 +247,9 @@ mpc52xx_gpt_irq_setup(struct mpc52xx_gpt_priv *gpt, struct device_node *node)
        if (!cascade_virq)
                return;
 
-       gpt->irqhost = irq_domain_add_linear(node, 1, &mpc52xx_gpt_irq_ops, gpt);
+       gpt->irqhost = irq_domain_create_linear(of_fwnode_handle(node), 1, &mpc52xx_gpt_irq_ops, gpt);
        if (!gpt->irqhost) {
-               dev_err(gpt->dev, "irq_domain_add_linear() failed\n");
+               dev_err(gpt->dev, "irq_domain_create_linear() failed\n");
                return;
        }
 
index 43c881d31ca6eb1103c294b5fccaa4c05d579197..7ec56d3788a9006c8a3a1967f12f648e44945b1c 100644 (file)
@@ -446,7 +446,7 @@ void __init mpc52xx_init_irq(void)
         * As last step, add an irq host to translate the real
         * hw irq information provided by the ofw to linux virq
         */
-       mpc52xx_irqhost = irq_domain_add_linear(picnode,
+       mpc52xx_irqhost = irq_domain_create_linear(of_fwnode_handle(picnode),
                                         MPC52xx_IRQ_HIGHTESTHWIRQ,
                                         &mpc52xx_irqhost_ops, NULL);
 
index 60e0b8947ce6106873dcc1abb22b51450524c3b2..b4f6360830b1b6ac280e5522e21820ca2488da71 100644 (file)
@@ -278,7 +278,7 @@ void __init socrates_fpga_pic_init(struct device_node *pic)
        int i;
 
        /* Setup an irq_domain structure */
-       socrates_fpga_pic_irq_host = irq_domain_add_linear(pic,
+       socrates_fpga_pic_irq_host = irq_domain_create_linear(of_fwnode_handle(pic),
                    SOCRATES_FPGA_NUM_IRQS, &socrates_fpga_pic_host_ops, NULL);
        if (socrates_fpga_pic_irq_host == NULL) {
                pr_err("FPGA PIC: Unable to allocate host\n");
index a18fc7c99f83a0844d38eeb442bc5501b27baa4d..1549f6cd29f48b5f92f6c6f76762898b3914533d 100644 (file)
@@ -110,7 +110,8 @@ static int cpm_pic_probe(struct platform_device *pdev)
 
        out_be32(&data->reg->cpic_cimr, 0);
 
-       data->host = irq_domain_add_linear(dev->of_node, 64, &cpm_pic_host_ops, data);
+       data->host = irq_domain_create_linear(of_fwnode_handle(dev->of_node),
+                                             64, &cpm_pic_host_ops, data);
        if (!data->host)
                return -ENODEV;
 
index ea6b0e523c60f05f92100c967b5ada9f565e6301..7639f28172becf0beafcaca606a4fba04cc0a6df 100644 (file)
@@ -146,7 +146,8 @@ void __init mpc8xx_pic_init(void)
        if (!siu_reg)
                goto out;
 
-       mpc8xx_pic_host = irq_domain_add_linear(np, 64, &mpc8xx_pic_host_ops, NULL);
+       mpc8xx_pic_host = irq_domain_create_linear(of_fwnode_handle(np), 64,
+                                                  &mpc8xx_pic_host_ops, NULL);
        if (!mpc8xx_pic_host)
                printk(KERN_ERR "MPC8xx PIC: failed to allocate irq host!\n");
 
index 013d66304c319d81a671c1feb174de43e5b3d7fe..a41649bf0cb8379192ddbc4b45c66f5d6c5dd6fd 100644 (file)
@@ -149,8 +149,9 @@ static struct irq_domain * __init flipper_pic_init(struct device_node *np)
 
        __flipper_quiesce(io_base);
 
-       irq_domain = irq_domain_add_linear(np, FLIPPER_NR_IRQS,
-                                 &flipper_irq_domain_ops, io_base);
+       irq_domain = irq_domain_create_linear(of_fwnode_handle(np),
+                                             FLIPPER_NR_IRQS,
+                                             &flipper_irq_domain_ops, io_base);
        if (!irq_domain) {
                pr_err("failed to allocate irq_domain\n");
                return NULL;
index 4d2d92de30afd643b3144523f4de62d95093a78f..9abb3da36ba5a52ab9f6756ece3a3460f8a2e39c 100644 (file)
@@ -175,8 +175,9 @@ static struct irq_domain *__init hlwd_pic_init(struct device_node *np)
 
        __hlwd_quiesce(io_base);
 
-       irq_domain = irq_domain_add_linear(np, HLWD_NR_IRQS,
-                                          &hlwd_irq_domain_ops, io_base);
+       irq_domain = irq_domain_create_linear(of_fwnode_handle(np),
+                                             HLWD_NR_IRQS,
+                                             &hlwd_irq_domain_ops, io_base);
        if (!irq_domain) {
                pr_err("failed to allocate irq_domain\n");
                iounmap(io_base);
index 03a7c51f264501848e5368da531aa4e06e90a2b1..2eddc8bff7abbe664dcc707a2c968b6bbffc063e 100644 (file)
@@ -327,8 +327,9 @@ static void __init pmac_pic_probe_oldstyle(void)
        /*
         * Allocate an irq host
         */
-       pmac_pic_host = irq_domain_add_linear(master, max_irqs,
-                                             &pmac_pic_host_ops, NULL);
+       pmac_pic_host = irq_domain_create_linear(of_fwnode_handle(master),
+                                                max_irqs,
+                                                &pmac_pic_host_ops, NULL);
        BUG_ON(pmac_pic_host == NULL);
        irq_set_default_domain(pmac_pic_host);
 
index d92759c21fae94256a8b714260873962abfa15ab..e180bd8e1400a88d40417eccdabfba6ec3407eec 100644 (file)
@@ -191,7 +191,8 @@ int __init opal_event_init(void)
         * fall back to the legacy method (opal_event_request(...))
         * anyway. */
        dn = of_find_compatible_node(NULL, NULL, "ibm,opal-event");
-       opal_event_irqchip.domain = irq_domain_add_linear(dn, MAX_NUM_EVENTS,
+       opal_event_irqchip.domain = irq_domain_create_linear(of_fwnode_handle(dn),
+                               MAX_NUM_EVENTS,
                                &opal_event_domain_ops, &opal_event_irqchip);
        of_node_put(dn);
        if (!opal_event_irqchip.domain) {
index e14493685fe872ca2b7e25c2d7816b7adef89c20..c63d72f17a3e26e9990ab012e5ea82c64bf4de2b 100644 (file)
@@ -259,7 +259,8 @@ void cpm2_pic_init(struct device_node *node)
        out_be32(&cpm2_intctl->ic_scprrl, 0x05309770);
 
        /* create a legacy host */
-       cpm2_pic_host = irq_domain_add_linear(node, 64, &cpm2_pic_host_ops, NULL);
+       cpm2_pic_host = irq_domain_create_linear(of_fwnode_handle(node), 64,
+                                                &cpm2_pic_host_ops, NULL);
        if (cpm2_pic_host == NULL) {
                printk(KERN_ERR "CPM2 PIC: failed to allocate irq host!\n");
                return;
index fb502b72fca1d2653e8d56d2fa5862e03318758c..4ee8d36ca647925781a4ebd863a23e5abf270a8c 100644 (file)
@@ -269,8 +269,9 @@ void __init ehv_pic_init(void)
                return;
        }
 
-       ehv_pic->irqhost = irq_domain_add_linear(np, NR_EHV_PIC_INTS,
-                                                &ehv_pic_host_ops, ehv_pic);
+       ehv_pic->irqhost = irq_domain_create_linear(of_fwnode_handle(np),
+                                                   NR_EHV_PIC_INTS,
+                                                   &ehv_pic_host_ops, ehv_pic);
        if (!ehv_pic->irqhost) {
                of_node_put(np);
                kfree(ehv_pic);
index 7b9a5ea9cad9d3c705e38ea8fb6799e6b77a9a5f..4fe8a7b1b288e09b4a7b8b06881ee3c9e9528660 100644 (file)
@@ -412,7 +412,7 @@ static int fsl_of_msi_probe(struct platform_device *dev)
        }
        platform_set_drvdata(dev, msi);
 
-       msi->irqhost = irq_domain_add_linear(dev->dev.of_node,
+       msi->irqhost = irq_domain_create_linear(of_fwnode_handle(dev->dev.of_node),
                                      NR_MSI_IRQS_MAX, &fsl_msi_host_ops, msi);
 
        if (msi->irqhost == NULL) {
index a6c424680c377633d2b9d56e0360ae53d0a5d553..5b1f8dc3c9602ec7b085860b61fbc0fbc84dad48 100644 (file)
@@ -214,8 +214,9 @@ void __init gef_pic_init(struct device_node *np)
        }
 
        /* Setup an irq_domain structure */
-       gef_pic_irq_host = irq_domain_add_linear(np, GEF_PIC_NUM_IRQS,
-                                         &gef_pic_host_ops, NULL);
+       gef_pic_irq_host = irq_domain_create_linear(of_fwnode_handle(np),
+                                                   GEF_PIC_NUM_IRQS,
+                                                   &gef_pic_host_ops, NULL);
        if (gef_pic_irq_host == NULL)
                return;
 
index 06e391485da72f1a70214072fd2d27824419ad05..99bb2b916949a0a0a7c7501a621326b9f2a12a2b 100644 (file)
@@ -260,8 +260,8 @@ void i8259_init(struct device_node *node, unsigned long intack_addr)
        raw_spin_unlock_irqrestore(&i8259_lock, flags);
 
        /* create a legacy host */
-       i8259_host = irq_domain_add_legacy(node, NR_IRQS_LEGACY, 0, 0,
-                                          &i8259_host_ops, NULL);
+       i8259_host = irq_domain_create_legacy(of_fwnode_handle(node), NR_IRQS_LEGACY, 0, 0,
+                                             &i8259_host_ops, NULL);
        if (i8259_host == NULL) {
                printk(KERN_ERR "i8259: failed to allocate irq host !\n");
                return;
index a35be0232978116751d95e563b2fea91edb8fe01..f7b415ebb71c7854965beb37a3a7d383c5c8197f 100644 (file)
@@ -711,8 +711,9 @@ struct ipic * __init ipic_init(struct device_node *node, unsigned int flags)
        if (ipic == NULL)
                return NULL;
 
-       ipic->irqhost = irq_domain_add_linear(node, NR_IPIC_INTS,
-                                             &ipic_host_ops, ipic);
+       ipic->irqhost = irq_domain_create_linear(of_fwnode_handle(node),
+                                                NR_IPIC_INTS,
+                                                &ipic_host_ops, ipic);
        if (ipic->irqhost == NULL) {
                kfree(ipic);
                return NULL;
index 4afbab83a2e2f3e1b6ce0cfd3bf4bebf662eafcb..3de090159a1b6b792cf064ebb08598e51f113b2f 100644 (file)
@@ -1483,9 +1483,9 @@ struct mpic * __init mpic_alloc(struct device_node *node,
        mpic->isu_shift = 1 + __ilog2(mpic->isu_size - 1);
        mpic->isu_mask = (1 << mpic->isu_shift) - 1;
 
-       mpic->irqhost = irq_domain_add_linear(mpic->node,
-                                      intvec_top,
-                                      &mpic_host_ops, mpic);
+       mpic->irqhost = irq_domain_create_linear(of_fwnode_handle(mpic->node),
+                                                intvec_top,
+                                                &mpic_host_ops, mpic);
 
        /*
         * FIXME: The code leaks the MPIC object and mappings here; this
index 0e42f7bad7db170af39d83c6006fc2d618d83437..07d0f6a838794f6281fd10dfbbce876c9da2b5dc 100644 (file)
@@ -404,8 +404,8 @@ void __init tsi108_pci_int_init(struct device_node *node)
 {
        DBG("Tsi108_pci_int_init: initializing PCI interrupts\n");
 
-       pci_irq_host = irq_domain_add_legacy(node, NR_IRQS_LEGACY, 0, 0,
-                                            &pci_irq_domain_ops, NULL);
+       pci_irq_host = irq_domain_create_legacy(of_fwnode_handle(node), NR_IRQS_LEGACY, 0, 0,
+                                               &pci_irq_domain_ops, NULL);
        if (pci_irq_host == NULL) {
                printk(KERN_ERR "pci_irq_host: failed to allocate irq domain!\n");
                return;
index dc2e61837396e1f7cb8189bdcf16ad1015b1eb18..f10592405024794cbee5853bd336fe0dd6e0c0f9 100644 (file)
@@ -1464,7 +1464,7 @@ static const struct irq_domain_ops xive_irq_domain_ops = {
 
 static void __init xive_init_host(struct device_node *np)
 {
-       xive_irq_domain = irq_domain_add_tree(np, &xive_irq_domain_ops, NULL);
+       xive_irq_domain = irq_domain_create_tree(of_fwnode_handle(np), &xive_irq_domain_ops, NULL);
        if (WARN_ON(xive_irq_domain == NULL))
                return;
        irq_set_default_domain(xive_irq_domain);