]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mfd: Use dev_fwnode() instead of of_fwnode_handle()
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Wed, 11 Jun 2025 10:43:41 +0000 (12:43 +0200)
committerLee Jones <lee@kernel.org>
Thu, 24 Jul 2025 10:27:02 +0000 (11:27 +0100)
irq_domain_create_simple() takes fwnode as the first argument. It can be
extracted from the struct device using dev_fwnode() helper instead of
using of_node with of_fwnode_handle().

So use the dev_fwnode() helper.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20250611104348.192092-13-jirislaby@kernel.org
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/mfd/ab8500-core.c
drivers/mfd/fsl-imx25-tsadc.c
drivers/mfd/lp8788-irq.c
drivers/mfd/mt6358-irq.c
drivers/mfd/mt6397-irq.c
drivers/mfd/qcom-pm8xxx.c
drivers/mfd/stmfx.c
drivers/mfd/tps65217.c
drivers/mfd/tps6586x.c
drivers/mfd/twl6030-irq.c
drivers/mfd/wm831x-irq.c

index 049abcbd71ceb7a382bc3624da2160b49af218e1..f0bc0b5a6f4adea7e7719d5723b604500f46f573 100644 (file)
@@ -580,8 +580,7 @@ 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_create_simple(of_fwnode_handle(ab8500->dev->of_node),
-                                                 num_irqs, 0,
+       ab8500->domain = irq_domain_create_simple(dev_fwnode(ab8500->dev), num_irqs, 0,
                                                  &ab8500_irq_ops, ab8500);
 
        if (!ab8500->domain) {
index d47152467951faaf75454964848bfade5ce1aa2a..0aab6428e04232b531f5c284982088e4d9be9200 100644 (file)
@@ -71,8 +71,8 @@ static int mx25_tsadc_setup_irq(struct platform_device *pdev,
        if (irq < 0)
                return irq;
 
-       tsadc->domain = irq_domain_create_simple(of_fwnode_handle(dev->of_node), 2, 0,
-                                                &mx25_tsadc_domain_ops, tsadc);
+       tsadc->domain = irq_domain_create_simple(dev_fwnode(dev), 2, 0, &mx25_tsadc_domain_ops,
+                                                tsadc);
        if (!tsadc->domain) {
                dev_err(dev, "Failed to add irq domain\n");
                return -ENOMEM;
index ea0fdf7a4b6e1894c171ce5fdc41a95b4085ee01..f62fa2d7f010c4b89ea633d0283beaa6b96d282e 100644 (file)
@@ -161,7 +161,7 @@ int lp8788_irq_init(struct lp8788 *lp, int irq)
                return -ENOMEM;
 
        irqd->lp = lp;
-       irqd->domain = irq_domain_create_linear(of_fwnode_handle(lp->dev->of_node), LP8788_INT_MAX,
+       irqd->domain = irq_domain_create_linear(dev_fwnode(lp->dev), LP8788_INT_MAX,
                                        &lp8788_domain_ops, irqd);
        if (!irqd->domain) {
                dev_err(lp->dev, "failed to add irq domain err\n");
index 9f0bcc3ad7a1e89f7d8ddadd3795ea713c0444e3..f467b00d236600321ffdac156cb641f3cf2b43f7 100644 (file)
@@ -272,8 +272,7 @@ int mt6358_irq_init(struct mt6397_chip *chip)
                                     irqd->pmic_ints[i].en_reg_shift * j, 0);
        }
 
-       chip->irq_domain = irq_domain_create_linear(of_fwnode_handle(chip->dev->of_node),
-                                                   irqd->num_pmic_irqs,
+       chip->irq_domain = irq_domain_create_linear(dev_fwnode(chip->dev), irqd->num_pmic_irqs,
                                                    &mt6358_irq_domain_ops, chip);
        if (!chip->irq_domain) {
                dev_err(chip->dev, "Could not create IRQ domain\n");
index badc614b434527ea5a7d936d9e3fe2552da9fe4d..0e463026c5a918b2dc5a43c13d9badcc576f908d 100644 (file)
@@ -216,8 +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_create_linear(of_fwnode_handle(chip->dev->of_node),
-                                                   MT6397_IRQ_NR, &mt6397_irq_domain_ops, chip);
+       chip->irq_domain = irq_domain_create_linear(dev_fwnode(chip->dev), 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 c96ea6fbede8b572930eb10f0b7743e6b1921b13..1149f7102a3656ac963784a2beed1a664fa3f776 100644 (file)
@@ -559,8 +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_create_linear(of_fwnode_handle(pdev->dev.of_node),
-                                                  data->num_irqs, &pm8xxx_irq_domain_ops, chip);
+       chip->irqdomain = irq_domain_create_linear(dev_fwnode(&pdev->dev), data->num_irqs,
+                                                  &pm8xxx_irq_domain_ops, chip);
        if (!chip->irqdomain)
                return -ENODEV;
 
index 823b1d29389e23d7d9f3e87d455b4d30c224055d..f683fdb6ece66539a93bb232e76f211d258dafb3 100644 (file)
@@ -269,9 +269,8 @@ static int stmfx_irq_init(struct i2c_client *client)
        u32 irqoutpin = 0, irqtrigger;
        int ret;
 
-       stmfx->irq_domain = irq_domain_create_simple(of_fwnode_handle(stmfx->dev->of_node),
-                                                 STMFX_REG_IRQ_SRC_MAX, 0,
-                                                 &stmfx_irq_ops, stmfx);
+       stmfx->irq_domain = irq_domain_create_simple(dev_fwnode(stmfx->dev), STMFX_REG_IRQ_SRC_MAX,
+                                                    0, &stmfx_irq_ops, stmfx);
        if (!stmfx->irq_domain) {
                dev_err(stmfx->dev, "Failed to create IRQ domain\n");
                return -EINVAL;
index 4e9669d327b4d9465894a1fb3005572e1e42828a..c240fac0ede76dd5fcec2d9a9f0cc45e5a300780 100644 (file)
@@ -158,8 +158,8 @@ 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_create_linear(of_fwnode_handle(tps->dev->of_node),
-               TPS65217_NUM_IRQ, &tps65217_irq_domain_ops, tps);
+       tps->irq_domain = irq_domain_create_linear(dev_fwnode(tps->dev), TPS65217_NUM_IRQ,
+                                                  &tps65217_irq_domain_ops, tps);
        if (!tps->irq_domain) {
                dev_err(tps->dev, "Could not create IRQ domain\n");
                return -ENOMEM;
index 853c482860712fde300d4f10dedac4f6c16bc784..8d5fe2b60bfa550d0aad30acd0820fac354028ac 100644 (file)
@@ -363,9 +363,9 @@ static int tps6586x_irq_init(struct tps6586x *tps6586x, int irq,
                new_irq_base = 0;
        }
 
-       tps6586x->irq_domain = irq_domain_create_simple(of_fwnode_handle(tps6586x->dev->of_node),
-                               irq_num, new_irq_base, &tps6586x_domain_ops,
-                               tps6586x);
+       tps6586x->irq_domain = irq_domain_create_simple(dev_fwnode(tps6586x->dev), irq_num,
+                                                       new_irq_base, &tps6586x_domain_ops,
+                                                       tps6586x);
        if (!tps6586x->irq_domain) {
                dev_err(tps6586x->dev, "Failed to create IRQ domain\n");
                return -ENOMEM;
index ffb4b98639c7ddf9934d38f62817c98457d01bee..0ca00f618d4d4e22701009e14c2c338714480386 100644 (file)
@@ -336,9 +336,8 @@ int twl6030_init_irq(struct device *dev, int irq_num)
        atomic_set(&twl6030_irq->wakeirqs, 0);
        twl6030_irq->irq_mapping_tbl = of_id->data;
 
-       twl6030_irq->irq_domain =
-               irq_domain_create_linear(of_fwnode_handle(dev->of_node), nr_irqs,
-                                        &twl6030_irq_domain_ops, twl6030_irq);
+       twl6030_irq->irq_domain = irq_domain_create_linear(dev_fwnode(dev), 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 b3883fa5dd9f108a097fce1d44e5cddc841ad99a..defd5f173eb62daf2705397809861f49623f0a54 100644 (file)
@@ -587,13 +587,11 @@ int wm831x_irq_init(struct wm831x *wm831x, int irq)
        }
 
        if (irq_base)
-               domain = irq_domain_create_legacy(of_fwnode_handle(wm831x->dev->of_node),
-                                                 ARRAY_SIZE(wm831x_irqs), irq_base, 0,
-                                                 &wm831x_irq_domain_ops, wm831x);
+               domain = irq_domain_create_legacy(dev_fwnode(wm831x->dev), ARRAY_SIZE(wm831x_irqs),
+                                                 irq_base, 0, &wm831x_irq_domain_ops, wm831x);
        else
-               domain = irq_domain_create_linear(of_fwnode_handle(wm831x->dev->of_node),
-                                                 ARRAY_SIZE(wm831x_irqs), &wm831x_irq_domain_ops,
-                                                 wm831x);
+               domain = irq_domain_create_linear(dev_fwnode(wm831x->dev), ARRAY_SIZE(wm831x_irqs),
+                                                 &wm831x_irq_domain_ops, wm831x);
 
        if (!domain) {
                dev_warn(wm831x->dev, "Failed to allocate IRQ domain\n");