]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mfd: Switch to irq_domain_create_*()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 19 Mar 2025 09:29:17 +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-25-jirislaby@kernel.org
21 files changed:
drivers/mfd/88pm860x-core.c
drivers/mfd/ab8500-core.c
drivers/mfd/arizona-irq.c
drivers/mfd/db8500-prcmu.c
drivers/mfd/fsl-imx25-tsadc.c
drivers/mfd/lp8788-irq.c
drivers/mfd/max8925-core.c
drivers/mfd/max8997-irq.c
drivers/mfd/max8998-irq.c
drivers/mfd/mt6358-irq.c
drivers/mfd/mt6397-irq.c
drivers/mfd/qcom-pm8xxx.c
drivers/mfd/stmfx.c
drivers/mfd/stmpe.c
drivers/mfd/tc3589x.c
drivers/mfd/tps65217.c
drivers/mfd/tps6586x.c
drivers/mfd/twl4030-irq.c
drivers/mfd/twl6030-irq.c
drivers/mfd/wm831x-irq.c
drivers/mfd/wm8994-irq.c

index 8e68b64bd7f8ae91594cef34a2f2408c655940c4..488e346047c1202d00a1059bd4317e7986933b29 100644 (file)
@@ -624,8 +624,8 @@ static int device_irq_init(struct pm860x_chip *chip,
                ret = -EBUSY;
                goto out;
        }
-       irq_domain_add_legacy(node, nr_irqs, chip->irq_base, 0,
-                             &pm860x_irq_domain_ops, chip);
+       irq_domain_create_legacy(of_fwnode_handle(node), nr_irqs, chip->irq_base, 0,
+                                &pm860x_irq_domain_ops, chip);
        chip->core_irq = i2c->irq;
        if (!chip->core_irq)
                goto out;
index 15c95828b09a73c47fb687283a8e52f061a75ca0..049abcbd71ceb7a382bc3624da2160b49af218e1 100644 (file)
@@ -580,9 +580,9 @@ static int ab8500_irq_init(struct ab8500 *ab8500, struct device_node *np)
                num_irqs = AB8500_NR_IRQS;
 
        /* If ->irq_base is zero this will give a linear mapping */
-       ab8500->domain = irq_domain_add_simple(ab8500->dev->of_node,
-                                              num_irqs, 0,
-                                              &ab8500_irq_ops, ab8500);
+       ab8500->domain = irq_domain_create_simple(of_fwnode_handle(ab8500->dev->of_node),
+                                                 num_irqs, 0,
+                                                 &ab8500_irq_ops, ab8500);
 
        if (!ab8500->domain) {
                dev_err(ab8500->dev, "Failed to create irqdomain\n");
index d919ae9691e23ac6a429e45635d9f90f3286b632..ac2139597fabd81fa50aa6f7f30e09453c4642fd 100644 (file)
@@ -312,8 +312,7 @@ int arizona_irq_init(struct arizona *arizona)
        flags |= arizona->pdata.irq_flags;
 
        /* Allocate a virtual IRQ domain to distribute to the regmap domains */
-       arizona->virq = irq_domain_add_linear(NULL, 2, &arizona_domain_ops,
-                                             arizona);
+       arizona->virq = irq_domain_create_linear(NULL, 2, &arizona_domain_ops, arizona);
        if (!arizona->virq) {
                dev_err(arizona->dev, "Failed to add core IRQ domain\n");
                ret = -EINVAL;
index 5b3e355e78f6b2040924f011c2a385a1016e36ad..21e68a382b11453ce3d2ec1b1a0842327ef5d560 100644 (file)
@@ -2607,9 +2607,9 @@ static int db8500_irq_init(struct device_node *np)
 {
        int i;
 
-       db8500_irq_domain = irq_domain_add_simple(
-               np, NUM_PRCMU_WAKEUPS, 0,
-               &db8500_irq_ops, NULL);
+       db8500_irq_domain = irq_domain_create_simple(of_fwnode_handle(np),
+                                                    NUM_PRCMU_WAKEUPS, 0,
+                                                    &db8500_irq_ops, NULL);
 
        if (!db8500_irq_domain) {
                pr_err("Failed to create irqdomain\n");
index 6fe388da6fb6e8c2c1e7fc2815c93fd279057482..d47152467951faaf75454964848bfade5ce1aa2a 100644 (file)
@@ -65,15 +65,14 @@ static int mx25_tsadc_setup_irq(struct platform_device *pdev,
                                struct mx25_tsadc *tsadc)
 {
        struct device *dev = &pdev->dev;
-       struct device_node *np = dev->of_node;
        int irq;
 
        irq = platform_get_irq(pdev, 0);
        if (irq < 0)
                return irq;
 
-       tsadc->domain = irq_domain_add_simple(np, 2, 0, &mx25_tsadc_domain_ops,
-                                             tsadc);
+       tsadc->domain = irq_domain_create_simple(of_fwnode_handle(dev->of_node), 2, 0,
+                                                &mx25_tsadc_domain_ops, tsadc);
        if (!tsadc->domain) {
                dev_err(dev, "Failed to add irq domain\n");
                return -ENOMEM;
index 39006297f3d2703ac852f2ffef33abf1cb13132a..ea0fdf7a4b6e1894c171ce5fdc41a95b4085ee01 100644 (file)
@@ -161,7 +161,7 @@ int lp8788_irq_init(struct lp8788 *lp, int irq)
                return -ENOMEM;
 
        irqd->lp = lp;
-       irqd->domain = irq_domain_add_linear(lp->dev->of_node, LP8788_INT_MAX,
+       irqd->domain = irq_domain_create_linear(of_fwnode_handle(lp->dev->of_node), LP8788_INT_MAX,
                                        &lp8788_domain_ops, irqd);
        if (!irqd->domain) {
                dev_err(lp->dev, "failed to add irq domain err\n");
index 105d79b9149373d1bde5209b19cd9177c0e4532b..78b16c67a5fc6ef2298c722d98b3647e3f43765d 100644 (file)
@@ -682,8 +682,8 @@ static int max8925_irq_init(struct max8925_chip *chip, int irq,
                return -EBUSY;
        }
 
-       irq_domain_add_legacy(node, MAX8925_NR_IRQS, chip->irq_base, 0,
-                             &max8925_irq_domain_ops, chip);
+       irq_domain_create_legacy(of_fwnode_handle(node), MAX8925_NR_IRQS, chip->irq_base, 0,
+                                &max8925_irq_domain_ops, chip);
 
        /* request irq handler for pmic main irq*/
        chip->core_irq = irq;
index 92e348df03d1e177ec823cd5d9187e90266a27df..cc87571c9af579ce728c098ed2b996976f686c74 100644 (file)
@@ -327,8 +327,8 @@ int max8997_irq_init(struct max8997_dev *max8997)
                                        true : false;
        }
 
-       domain = irq_domain_add_linear(NULL, MAX8997_IRQ_NR,
-                                       &max8997_irq_domain_ops, max8997);
+       domain = irq_domain_create_linear(NULL, MAX8997_IRQ_NR,
+                                         &max8997_irq_domain_ops, max8997);
        if (!domain) {
                dev_err(max8997->dev, "could not create irq domain\n");
                return -ENODEV;
index 83b6f510bc0543975731cc71081c014283136a92..b0773fa6e07fc09e49e3dc3d18613913b176475a 100644 (file)
@@ -230,7 +230,7 @@ int max8998_irq_init(struct max8998_dev *max8998)
        max8998_write_reg(max8998->i2c, MAX8998_REG_STATUSM1, 0xff);
        max8998_write_reg(max8998->i2c, MAX8998_REG_STATUSM2, 0xff);
 
-       domain = irq_domain_add_simple(NULL, MAX8998_IRQ_NR,
+       domain = irq_domain_create_simple(NULL, MAX8998_IRQ_NR,
                        max8998->irq_base, &max8998_irq_domain_ops, max8998);
        if (!domain) {
                dev_err(max8998->dev, "could not create irq domain\n");
index 49830b526ee880bf36fda79b6fe54c12ec3d74d6..9f0bcc3ad7a1e89f7d8ddadd3795ea713c0444e3 100644 (file)
@@ -272,9 +272,9 @@ int mt6358_irq_init(struct mt6397_chip *chip)
                                     irqd->pmic_ints[i].en_reg_shift * j, 0);
        }
 
-       chip->irq_domain = irq_domain_add_linear(chip->dev->of_node,
-                                                irqd->num_pmic_irqs,
-                                                &mt6358_irq_domain_ops, chip);
+       chip->irq_domain = irq_domain_create_linear(of_fwnode_handle(chip->dev->of_node),
+                                                   irqd->num_pmic_irqs,
+                                                   &mt6358_irq_domain_ops, chip);
        if (!chip->irq_domain) {
                dev_err(chip->dev, "Could not create IRQ domain\n");
                return -ENODEV;
index 1310665200ede4e0c32688a4dd6f9227efa572d3..badc614b434527ea5a7d936d9e3fe2552da9fe4d 100644 (file)
@@ -216,10 +216,8 @@ int mt6397_irq_init(struct mt6397_chip *chip)
                regmap_write(chip->regmap, chip->int_con[2], 0x0);
 
        chip->pm_nb.notifier_call = mt6397_irq_pm_notifier;
-       chip->irq_domain = irq_domain_add_linear(chip->dev->of_node,
-                                                MT6397_IRQ_NR,
-                                                &mt6397_irq_domain_ops,
-                                                chip);
+       chip->irq_domain = irq_domain_create_linear(of_fwnode_handle(chip->dev->of_node),
+                                                   MT6397_IRQ_NR, &mt6397_irq_domain_ops, chip);
        if (!chip->irq_domain) {
                dev_err(chip->dev, "could not create irq domain\n");
                return -ENOMEM;
index f9ebdf5845b85724c906201015136d37dd28b854..c96ea6fbede8b572930eb10f0b7743e6b1921b13 100644 (file)
@@ -559,10 +559,8 @@ static int pm8xxx_probe(struct platform_device *pdev)
        chip->pm_irq_data = data;
        spin_lock_init(&chip->pm_irq_lock);
 
-       chip->irqdomain = irq_domain_add_linear(pdev->dev.of_node,
-                                               data->num_irqs,
-                                               &pm8xxx_irq_domain_ops,
-                                               chip);
+       chip->irqdomain = irq_domain_create_linear(of_fwnode_handle(pdev->dev.of_node),
+                                                  data->num_irqs, &pm8xxx_irq_domain_ops, chip);
        if (!chip->irqdomain)
                return -ENODEV;
 
index f391c2ccaa72a7a7d947fb69fbe5c4bed5238d39..823b1d29389e23d7d9f3e87d455b4d30c224055d 100644 (file)
@@ -269,7 +269,7 @@ static int stmfx_irq_init(struct i2c_client *client)
        u32 irqoutpin = 0, irqtrigger;
        int ret;
 
-       stmfx->irq_domain = irq_domain_add_simple(stmfx->dev->of_node,
+       stmfx->irq_domain = irq_domain_create_simple(of_fwnode_handle(stmfx->dev->of_node),
                                                  STMFX_REG_IRQ_SRC_MAX, 0,
                                                  &stmfx_irq_ops, stmfx);
        if (!stmfx->irq_domain) {
index 9c3cf58457a7db69fc479cdb7e19192f762de81e..819d19dc9b4a91e160d917cb914767094173dbfe 100644 (file)
@@ -1219,8 +1219,8 @@ static int stmpe_irq_init(struct stmpe *stmpe, struct device_node *np)
        int base = 0;
        int num_irqs = stmpe->variant->num_irqs;
 
-       stmpe->domain = irq_domain_add_simple(np, num_irqs, base,
-                                             &stmpe_irq_ops, stmpe);
+       stmpe->domain = irq_domain_create_simple(of_fwnode_handle(np), num_irqs,
+                                                base, &stmpe_irq_ops, stmpe);
        if (!stmpe->domain) {
                dev_err(stmpe->dev, "Failed to create irqdomain\n");
                return -ENOSYS;
index ef953ee73145364d6acb996323242f4d2eac5041..2d4eb771e230f7a433231ee24f121241f4a56c8f 100644 (file)
@@ -234,9 +234,9 @@ static const struct irq_domain_ops tc3589x_irq_ops = {
 
 static int tc3589x_irq_init(struct tc3589x *tc3589x, struct device_node *np)
 {
-       tc3589x->domain = irq_domain_add_simple(
-               np, TC3589x_NR_INTERNAL_IRQS, 0,
-               &tc3589x_irq_ops, tc3589x);
+       tc3589x->domain = irq_domain_create_simple(of_fwnode_handle(np),
+                                                  TC3589x_NR_INTERNAL_IRQS, 0,
+                                                  &tc3589x_irq_ops, tc3589x);
 
        if (!tc3589x->domain) {
                dev_err(tc3589x->dev, "Failed to create irqdomain\n");
index 029ecc32f0782eaca507f6ec55d6c68cd4023ebe..4e9669d327b4d9465894a1fb3005572e1e42828a 100644 (file)
@@ -158,7 +158,7 @@ static int tps65217_irq_init(struct tps65217 *tps, int irq)
        tps65217_set_bits(tps, TPS65217_REG_INT, TPS65217_INT_MASK,
                          TPS65217_INT_MASK, TPS65217_PROTECT_NONE);
 
-       tps->irq_domain = irq_domain_add_linear(tps->dev->of_node,
+       tps->irq_domain = irq_domain_create_linear(of_fwnode_handle(tps->dev->of_node),
                TPS65217_NUM_IRQ, &tps65217_irq_domain_ops, tps);
        if (!tps->irq_domain) {
                dev_err(tps->dev, "Could not create IRQ domain\n");
index 82714899efb2c39b60c6ffb1a00590d9bb244461..853c482860712fde300d4f10dedac4f6c16bc784 100644 (file)
@@ -363,7 +363,7 @@ static int tps6586x_irq_init(struct tps6586x *tps6586x, int irq,
                new_irq_base = 0;
        }
 
-       tps6586x->irq_domain = irq_domain_add_simple(tps6586x->dev->of_node,
+       tps6586x->irq_domain = irq_domain_create_simple(of_fwnode_handle(tps6586x->dev->of_node),
                                irq_num, new_irq_base, &tps6586x_domain_ops,
                                tps6586x);
        if (!tps6586x->irq_domain) {
index 87496c1cb8bca617db30382cf06429482ceeeb7d..232c2bfe8c1801c8cf22208fcc25deb88e556c47 100644 (file)
@@ -691,8 +691,8 @@ int twl4030_init_irq(struct device *dev, int irq_num)
                return irq_base;
        }
 
-       irq_domain_add_legacy(node, nr_irqs, irq_base, 0,
-                             &irq_domain_simple_ops, NULL);
+       irq_domain_create_legacy(of_fwnode_handle(node), nr_irqs, irq_base, 0,
+                                &irq_domain_simple_ops, NULL);
 
        irq_end = irq_base + TWL4030_CORE_NR_IRQS;
 
index 3c03681c124c044ae942aee5ccb223ce70ded8bc..00b14cef1dfb59e32911115690ee55154215e817 100644 (file)
@@ -364,7 +364,6 @@ static const struct of_device_id twl6030_of_match[] __maybe_unused = {
 
 int twl6030_init_irq(struct device *dev, int irq_num)
 {
-       struct                  device_node *node = dev->of_node;
        int                     nr_irqs;
        int                     status;
        u8                      mask[3];
@@ -412,8 +411,8 @@ int twl6030_init_irq(struct device *dev, int irq_num)
        twl6030_irq->irq_mapping_tbl = of_id->data;
 
        twl6030_irq->irq_domain =
-               irq_domain_add_linear(node, nr_irqs,
-                                     &twl6030_irq_domain_ops, twl6030_irq);
+               irq_domain_create_linear(of_fwnode_handle(dev->of_node), nr_irqs,
+                                        &twl6030_irq_domain_ops, twl6030_irq);
        if (!twl6030_irq->irq_domain) {
                dev_err(dev, "Can't add irq_domain\n");
                return -ENOMEM;
index f1f58e3149ae0e7e17e76c68077c9540d34563fa..b3883fa5dd9f108a097fce1d44e5cddc841ad99a 100644 (file)
@@ -587,16 +587,13 @@ int wm831x_irq_init(struct wm831x *wm831x, int irq)
        }
 
        if (irq_base)
-               domain = irq_domain_add_legacy(wm831x->dev->of_node,
-                                              ARRAY_SIZE(wm831x_irqs),
-                                              irq_base, 0,
-                                              &wm831x_irq_domain_ops,
-                                              wm831x);
+               domain = irq_domain_create_legacy(of_fwnode_handle(wm831x->dev->of_node),
+                                                 ARRAY_SIZE(wm831x_irqs), irq_base, 0,
+                                                 &wm831x_irq_domain_ops, wm831x);
        else
-               domain = irq_domain_add_linear(wm831x->dev->of_node,
-                                              ARRAY_SIZE(wm831x_irqs),
-                                              &wm831x_irq_domain_ops,
-                                              wm831x);
+               domain = irq_domain_create_linear(of_fwnode_handle(wm831x->dev->of_node),
+                                                 ARRAY_SIZE(wm831x_irqs), &wm831x_irq_domain_ops,
+                                                 wm831x);
 
        if (!domain) {
                dev_warn(wm831x->dev, "Failed to allocate IRQ domain\n");
index 651a028bc519a200db07c24418200445f1146d34..1475b1ac6983b8f9e4101a4b7ed1a5d162c7987c 100644 (file)
@@ -213,9 +213,7 @@ int wm8994_irq_init(struct wm8994 *wm8994)
                        return ret;
                }
 
-               wm8994->edge_irq = irq_domain_add_linear(NULL, 1,
-                                                        &wm8994_edge_irq_ops,
-                                                        wm8994);
+               wm8994->edge_irq = irq_domain_create_linear(NULL, 1, &wm8994_edge_irq_ops, wm8994);
 
                ret = regmap_add_irq_chip(wm8994->regmap,
                                          irq_create_mapping(wm8994->edge_irq,