]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: Switch to irq_domain_create_*()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 19 Mar 2025 09:29:20 +0000 (10:29 +0100)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 16 May 2025 19:06:10 +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>
Link: https://lore.kernel.org/all/20250319092951.37667-28-jirislaby@kernel.org
drivers/net/dsa/microchip/ksz_common.c
drivers/net/dsa/microchip/ksz_ptp.c
drivers/net/dsa/mv88e6xxx/chip.c
drivers/net/dsa/mv88e6xxx/global2.c
drivers/net/dsa/qca/ar9331.c
drivers/net/dsa/realtek/rtl8365mb.c
drivers/net/dsa/realtek/rtl8366rb.c
drivers/net/ethernet/wangxun/txgbe/txgbe_irq.c
drivers/net/usb/lan78xx.c

index 89f0796894af6621fe0261b3472c822254c82cb7..579ee504fed5f27cc9b9dc902889a11da6853879 100644 (file)
@@ -2697,8 +2697,9 @@ static int ksz_irq_common_setup(struct ksz_device *dev, struct ksz_irq *kirq)
        kirq->dev = dev;
        kirq->masked = ~0;
 
-       kirq->domain = irq_domain_add_simple(dev->dev->of_node, kirq->nirqs, 0,
-                                            &ksz_irq_domain_ops, kirq);
+       kirq->domain = irq_domain_create_simple(of_fwnode_handle(dev->dev->of_node),
+                                               kirq->nirqs, 0,
+                                               &ksz_irq_domain_ops, kirq);
        if (!kirq->domain)
                return -ENOMEM;
 
index 22fb9ef4645c184a667298b1a3f0b7c44b9ccba4..992101e4bdee5d904b331c7f23ab569245f99162 100644 (file)
@@ -1136,8 +1136,8 @@ int ksz_ptp_irq_setup(struct dsa_switch *ds, u8 p)
 
        init_completion(&port->tstamp_msg_comp);
 
-       ptpirq->domain = irq_domain_add_linear(dev->dev->of_node, ptpirq->nirqs,
-                                              &ksz_ptp_irq_domain_ops, ptpirq);
+       ptpirq->domain = irq_domain_create_linear(of_fwnode_handle(dev->dev->of_node),
+                                                 ptpirq->nirqs, &ksz_ptp_irq_domain_ops, ptpirq);
        if (!ptpirq->domain)
                return -ENOMEM;
 
index 29a89ab4b78946b60aaf825295ad005f77d467c9..dd616eb809ea5825a0d50c74e3b899aac157d2e6 100644 (file)
@@ -297,7 +297,7 @@ static int mv88e6xxx_g1_irq_setup_common(struct mv88e6xxx_chip *chip)
        u16 reg, mask;
 
        chip->g1_irq.nirqs = chip->info->g1_irqs;
-       chip->g1_irq.domain = irq_domain_add_simple(
+       chip->g1_irq.domain = irq_domain_create_simple(
                NULL, chip->g1_irq.nirqs, 0,
                &mv88e6xxx_g1_irq_domain_ops, chip);
        if (!chip->g1_irq.domain)
index b2b5f6ba438f46f2e8b39625a08e5eaae2d63d03..aaf97c1e3167b1b795b4740d80ee7c58f447a182 100644 (file)
@@ -1154,8 +1154,10 @@ int mv88e6xxx_g2_irq_setup(struct mv88e6xxx_chip *chip)
        if (err)
                return err;
 
-       chip->g2_irq.domain = irq_domain_add_simple(
-               chip->dev->of_node, 16, 0, &mv88e6xxx_g2_irq_domain_ops, chip);
+       chip->g2_irq.domain = irq_domain_create_simple(of_fwnode_handle(chip->dev->of_node),
+                                                      16, 0,
+                                                      &mv88e6xxx_g2_irq_domain_ops,
+                                                      chip);
        if (!chip->g2_irq.domain)
                return -ENOMEM;
 
index e9f2c67bc15f5dae364ca071619add734004c085..79a29676ca6f5bb0e636a10086be9ded6a68977e 100644 (file)
@@ -821,8 +821,8 @@ static int ar9331_sw_irq_init(struct ar9331_sw_priv *priv)
                return ret;
        }
 
-       priv->irqdomain = irq_domain_add_linear(np, 1, &ar9331_sw_irqdomain_ops,
-                                               priv);
+       priv->irqdomain = irq_domain_create_linear(of_fwnode_handle(np), 1,
+                                                  &ar9331_sw_irqdomain_ops, priv);
        if (!priv->irqdomain) {
                dev_err(dev, "failed to create IRQ domain\n");
                return -EINVAL;
index 7e96355c28bd4e7f2fce34a6c167c9310a3adcf3..964a56ee16cc941f10593597d251ffd52bc35bf9 100644 (file)
@@ -1719,8 +1719,8 @@ static int rtl8365mb_irq_setup(struct realtek_priv *priv)
                goto out_put_node;
        }
 
-       priv->irqdomain = irq_domain_add_linear(intc, priv->num_ports,
-                                               &rtl8365mb_irqdomain_ops, priv);
+       priv->irqdomain = irq_domain_create_linear(of_fwnode_handle(intc), priv->num_ports,
+                                                  &rtl8365mb_irqdomain_ops, priv);
        if (!priv->irqdomain) {
                dev_err(priv->dev, "failed to add irq domain\n");
                ret = -ENOMEM;
index f54771cab56d4f380f1048e4caf60203fe795104..8bdb52b5fdcb5a1823131e3a8637232dd9906769 100644 (file)
@@ -550,10 +550,8 @@ static int rtl8366rb_setup_cascaded_irq(struct realtek_priv *priv)
                dev_err(priv->dev, "unable to request irq: %d\n", ret);
                goto out_put_node;
        }
-       priv->irqdomain = irq_domain_add_linear(intc,
-                                               RTL8366RB_NUM_INTERRUPT,
-                                               &rtl8366rb_irqdomain_ops,
-                                               priv);
+       priv->irqdomain = irq_domain_create_linear(of_fwnode_handle(intc), RTL8366RB_NUM_INTERRUPT,
+                                                  &rtl8366rb_irqdomain_ops, priv);
        if (!priv->irqdomain) {
                dev_err(priv->dev, "failed to create IRQ domain\n");
                ret = -EINVAL;
index 8658a51ee8106eb74ba50a938c7f0714857612a9..f2c2bd257e3905ff07d4a32951b40d795517e7ee 100644 (file)
@@ -184,8 +184,8 @@ int txgbe_setup_misc_irq(struct txgbe *txgbe)
                goto skip_sp_irq;
 
        txgbe->misc.nirqs = 1;
-       txgbe->misc.domain = irq_domain_add_simple(NULL, txgbe->misc.nirqs, 0,
-                                                  &txgbe_misc_irq_domain_ops, txgbe);
+       txgbe->misc.domain = irq_domain_create_simple(NULL, txgbe->misc.nirqs, 0,
+                                                     &txgbe_misc_irq_domain_ops, txgbe);
        if (!txgbe->misc.domain)
                return -ENOMEM;
 
index e4f1663b62047b26321ad1a96ae96624632352f5..3e8025a71fcbc7f4230fa7f84b984bcb288b6198 100644 (file)
@@ -2456,14 +2456,11 @@ static struct irq_chip lan78xx_irqchip = {
 
 static int lan78xx_setup_irq_domain(struct lan78xx_net *dev)
 {
-       struct device_node *of_node;
        struct irq_domain *irqdomain;
        unsigned int irqmap = 0;
        u32 buf;
        int ret = 0;
 
-       of_node = dev->udev->dev.parent->of_node;
-
        mutex_init(&dev->domain_data.irq_lock);
 
        ret = lan78xx_read_reg(dev, INT_EP_CTL, &buf);
@@ -2475,8 +2472,10 @@ static int lan78xx_setup_irq_domain(struct lan78xx_net *dev)
        dev->domain_data.irqchip = &lan78xx_irqchip;
        dev->domain_data.irq_handler = handle_simple_irq;
 
-       irqdomain = irq_domain_add_simple(of_node, MAX_INT_EP, 0,
-                                         &chip_domain_ops, &dev->domain_data);
+       irqdomain = irq_domain_create_simple(of_fwnode_handle(dev->udev->dev.parent->of_node),
+                                            MAX_INT_EP, 0,
+                                            &chip_domain_ops,
+                                            &dev->domain_data);
        if (irqdomain) {
                /* create mapping for PHY interrupt */
                irqmap = irq_create_mapping(irqdomain, INT_EP_PHY);