Skip to contentSkip to conversation

mfd: fix building without CONFIG_OF

PATCH New Jiri Slaby (SUSE) 23 participants 55 messages Jun 11, 2025 – Jul 30, 2025

Subsystems (59)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: fix building without CONFIG_OF

From: Arnd Bergmann <[email protected]>

Using the of_fwnode_handle() means that local 'node' variables are unused whenever CONFIG_OF is disabled for compile testing:

drivers/mfd/88pm860x-core.c: In function 'device_irq_init':
drivers/mfd/88pm860x-core.c:576:29: error: unused variable 'node' [-Werror=unused-variable]
576 | struct device_node *node = i2c->dev.of_node;
| ^~~~
drivers/mfd/max8925-core.c: In function 'max8925_irq_init':
drivers/mfd/max8925-core.c:659:29: error: unused variable 'node' [-Werror=unused-variable]
659 | struct device_node *node = chip->dev->of_node;
| ^~~~
drivers/mfd/twl4030-irq.c: In function 'twl4030_init_irq':
drivers/mfd/twl4030-irq.c:679:46: error: unused variable 'node' [-Werror=unused-variable]
679 | struct device_node *node = dev->of_node;
| ^~~~

Replace these with the corresponding dev_fwnode() lookups that keep the code simpler in addition to avoiding the warnings.

Fixes e3d44f11da04 ("mfd: Switch to irq_domain_create_*()")
Cc Mario Limonciello <[email protected]>
Cc Nathan Chancellor <[email protected]>
---
 drivers/mfd/88pm860x-core.c | 3 +--
 drivers/mfd/max8925-core.c  | 6 +++---
 drivers/mfd/twl4030-irq.c   | 3 +--
 3 files changed, 5 insertions(+), 7 deletions(-)
drivers/mfd/88pm860x-core.c +1 -2
index 488e346047c1..77230fbe07be 100644
@@ -573,7 +573,6 @@ static int device_irq_init(struct pm860x_chip *chip,
 	unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT;
 	int data, mask, ret = -EINVAL;
 	int nr_irqs, irq_base = -1;
-	struct device_node *node = i2c->dev.of_node;
 
 	mask = PM8607_B0_MISC1_INV_INT | PM8607_B0_MISC1_INT_CLEAR
 		| PM8607_B0_MISC1_INT_MASK;
@@ -624,7 +623,7 @@ static int device_irq_init(struct pm860x_chip *chip,
 		ret = -EBUSY;
 		goto out;
 	}
-	irq_domain_create_legacy(of_fwnode_handle(node), nr_irqs, chip->irq_base, 0,
+	irq_domain_create_legacy(dev_fwnode(&i2c->dev), nr_irqs, chip->irq_base, 0,
 				 &pm860x_irq_domain_ops, chip);
 	chip->core_irq = i2c->irq;
 	if (!chip->core_irq)
drivers/mfd/max8925-core.c +3 -3
index 78b16c67a5fc..25377dcce60e 100644
@@ -656,7 +656,6 @@ static int max8925_irq_init(struct max8925_chip *chip, int irq,
 {
 	unsigned long flags = IRQF_TRIGGER_FALLING | IRQF_ONESHOT;
 	int ret;
-	struct device_node *node = chip->dev->of_node;
 
 	/* clear all interrupts */
 	max8925_reg_read(chip->i2c, MAX8925_CHG_IRQ1);
@@ -682,8 +681,9 @@ static int max8925_irq_init(struct max8925_chip *chip, int irq,
 		return -EBUSY;
 	}
 
-	irq_domain_create_legacy(of_fwnode_handle(node), MAX8925_NR_IRQS, chip->irq_base, 0,
-				 &max8925_irq_domain_ops, chip);
+	irq_domain_create_legacy(dev_fwnode(chip->dev), MAX8925_NR_IRQS,
+				 chip->irq_base, 0, &max8925_irq_domain_ops,
+				 chip);
 
 	/* request irq handler for pmic main irq*/
 	chip->core_irq = irq;
drivers/mfd/twl4030-irq.c +1 -2
index 232c2bfe8c18..d3ab40651307 100644
@@ -676,7 +676,6 @@ int twl4030_init_irq(struct device *dev, int irq_num)
 	static struct irq_chip	twl4030_irq_chip;
 	int			status, i;
 	int			irq_base, irq_end, nr_irqs;
-	struct			device_node *node = dev->of_node;
 
 	/*
 	 * TWL core and pwr interrupts must be contiguous because
@@ -691,7 +690,7 @@ int twl4030_init_irq(struct device *dev, int irq_num)
 		return irq_base;
 	}
 
-	irq_domain_create_legacy(of_fwnode_handle(node), nr_irqs, irq_base, 0,
+	irq_domain_create_legacy(dev_fwnode(dev), nr_irqs, irq_base, 0,
 				 &irq_domain_simple_ops, NULL);
 
 	irq_end = irq_base + TWL4030_CORE_NR_IRQS;
Signature · 1 line
2.49.0
#1 lore raw

PATCH 1/1 pci: altera: remove unused 'node' variable

From: Arnd Bergmann <[email protected]>

This variable is only used when CONFIG_OF is enabled:

drivers/pci/controller/pcie-altera.c: In function 'altera_pcie_init_irq_domain':
drivers/pci/controller/pcie-altera.c:855:29: error: unused variable 'node' [-Werror=unused-variable]
855 | struct device_node *node = dev->of_node;

Use dev_fwnode() in place of of_node_to_fwnode() to avoid this.

----
I checked the other PCI host bridge drivers as well, this is the only one with that problem.

Fixes bbc94e6f72f2 ("PCI: Switch to irq_domain_create_linear()")
---
 drivers/pci/controller/pcie-altera.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/controller/pcie-altera.c +1 -2
index 0fc77176a52e..3dbb7adc421c 100644
@@ -852,10 +852,9 @@ static void aglx_isr(struct irq_desc *desc)
 static int altera_pcie_init_irq_domain(struct altera_pcie *pcie)
 {
 	struct device *dev = &pcie->pdev->dev;
-	struct device_node *node = dev->of_node;
 
 	/* Setup INTx */
-	pcie->irq_domain = irq_domain_create_linear(of_fwnode_handle(node), PCI_NUM_INTX,
+	pcie->irq_domain = irq_domain_create_linear(dev_fwnode(dev), PCI_NUM_INTX,
 					&intx_domain_ops, pcie);
 	if (!pcie->irq_domain) {
 		dev_err(dev, "Failed to get a INTx IRQ domain\n");
Signature · 1 line
2.49.0
#2 lore raw

Re: [PATCH] pci: altera: remove unused 'node' variable

Quoted 10 lines · Jiri Slaby (SUSE)

From: Arnd Bergmann <[email protected]>

This variable is only used when CONFIG_OF is enabled:

drivers/pci/controller/pcie-altera.c: In function 'altera_pcie_init_irq_domain':
drivers/pci/controller/pcie-altera.c:855:29: error: unused variable 'node' [-Werror=unused-variable]
855 | struct device_node *node = dev->of_node;

Use dev_fwnode() in place of of_node_to_fwnode() to avoid this.

Quoted 8 lines

----
I checked the other PCI host bridge drivers as well, this is the only one with that problem.

Fixes bbc94e6f72f2 ("PCI: Switch to irq_domain_create_linear()")

Applied by Mani to pci/controller/altera. I amended the subject to match history.

Quoted 23 lines
---
 drivers/pci/controller/pcie-altera.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/controller/pcie-altera.c +1 -2
index 0fc77176a52e..3dbb7adc421c 100644
@@ -852,10 +852,9 @@ static void aglx_isr(struct irq_desc *desc)
 static int altera_pcie_init_irq_domain(struct altera_pcie *pcie)
 {
 	struct device *dev = &pcie->pdev->dev;
-	struct device_node *node = dev->of_node;
 
 	/* Setup INTx */
-	pcie->irq_domain = irq_domain_create_linear(of_fwnode_handle(node), PCI_NUM_INTX,
+	pcie->irq_domain = irq_domain_create_linear(dev_fwnode(dev), PCI_NUM_INTX,
 					&intx_domain_ops, pcie);
 	if (!pcie->irq_domain) {
 		dev_err(dev, "Failed to get a INTx IRQ domain\n");
Signature · 1 line
2.49.0
#3 lore raw

PATCH 1/1 bus: moxtet: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

---
 drivers/bus/moxtet.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/bus/moxtet.c +1 -2
index 6c3e5c5dae10..7ce61d629a87 100644
@@ -737,8 +737,7 @@ static int moxtet_irq_setup(struct moxtet *moxtet)
 {
 	int i, ret;
 
-	moxtet->irq.domain = irq_domain_create_simple(of_fwnode_handle(moxtet->dev->of_node),
-						      MOXTET_NIRQS, 0,
+	moxtet->irq.domain = irq_domain_create_simple(dev_fwnode(moxtet->dev), MOXTET_NIRQS, 0,
 						      &moxtet_irq_domain, moxtet);
 	if (moxtet->irq.domain == NULL) {
 		dev_err(moxtet->dev, "Could not add IRQ domain\n");
Signature · 1 line
2.49.0
maintainer Reviewed-by on v1 1/1
#4 lore raw

Re: [PATCH] bus: moxtet: Use dev_fwnode()

Quoted 29 lines · Jiri Slaby (SUSE)

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.

---
 drivers/bus/moxtet.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/bus/moxtet.c +1 -2
index 6c3e5c5dae10..7ce61d629a87 100644
@@ -737,8 +737,7 @@ static int moxtet_irq_setup(struct moxtet *moxtet)
 {
 	int i, ret;
 
-	moxtet->irq.domain = irq_domain_create_simple(of_fwnode_handle(moxtet->dev->of_node),
-						      MOXTET_NIRQS, 0,
+	moxtet->irq.domain = irq_domain_create_simple(dev_fwnode(moxtet->dev), MOXTET_NIRQS, 0,
 						      &moxtet_irq_domain, moxtet);
 	if (moxtet->irq.domain == NULL) {
 		dev_err(moxtet->dev, "Could not add IRQ domain\n");
Signature · 1 line
2.49.0
#5 lore raw

PATCH 1/1 drm/msm: use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

Cc Rob Clark <[email protected]>
Cc Abhinav Kumar <[email protected]>
Cc Dmitry Baryshkov <[email protected]>
Cc Sean Paul <[email protected]>
Cc Marijn Suijten <[email protected]>
Cc David Airlie <[email protected]>
Cc Simona Vetter <[email protected]>

---

---
 drivers/gpu/drm/msm/msm_mdss.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/msm/msm_mdss.c +1 -2
index 709979fcfab6..5ea2a2241246 100644
@@ -150,8 +150,7 @@ static int _msm_mdss_irq_domain_add(struct msm_mdss *msm_mdss)
 
 	dev = msm_mdss->dev;
 
-	domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node), 32,
-			&msm_mdss_irqdomain_ops, msm_mdss);
+	domain = irq_domain_create_linear(dev_fwnode(dev), 32, &msm_mdss_irqdomain_ops, msm_mdss);
 	if (!domain) {
 		dev_err(dev, "failed to add irq_domain\n");
 		return -EINVAL;
Signature · 1 line
2.49.0
#6 lore raw

PATCH 1/1 edac: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

Cc Dinh Nguyen <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Tony Luck <[email protected]>
Cc James Morse <[email protected]>
Cc Mauro Carvalho Chehab <[email protected]>
Cc Robert Richter <[email protected]>

---
Cc: [email protected]

---
 drivers/edac/altera_edac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/edac/altera_edac.c +2 -2
index cae52c654a15..cfd17a8e5865 100644
@@ -2131,8 +2131,8 @@ static int altr_edac_a10_probe(struct platform_device *pdev)
 	edac->irq_chip.name = pdev->dev.of_node->name;
 	edac->irq_chip.irq_mask = a10_eccmgr_irq_mask;
 	edac->irq_chip.irq_unmask = a10_eccmgr_irq_unmask;
-	edac->domain = irq_domain_create_linear(of_fwnode_handle(pdev->dev.of_node),
-						64, &a10_eccmgr_ic_ops, edac);
+	edac->domain = irq_domain_create_linear(dev_fwnode(&pdev->dev), 64, &a10_eccmgr_ic_ops,
+						edac);
 	if (!edac->domain) {
 		dev_err(&pdev->dev, "Error adding IRQ domain\n");
 		return -ENOMEM;
Signature · 1 line
2.49.0
#7 lore raw

PATCH 1/1 gpio: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

Cc Linus Walleij <[email protected]>
Cc Bartosz Golaszewski <[email protected]>

---
Cc: Doug Berger <[email protected]>
Cc: Florian Fainelli <[email protected]>
Cc: Broadcom internal kernel review list <[email protected]>
Cc: Keerthy <[email protected]>
Cc: Vladimir Zapolskiy <[email protected]>
Cc: "Uwe Kleine-König" <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Robert Jarzmik <[email protected]>
Cc: Heiko Stuebner <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 drivers/gpio/gpio-brcmstb.c   | 6 ++----
 drivers/gpio/gpio-davinci.c   | 2 +-
 drivers/gpio/gpio-em.c        | 3 +--
 drivers/gpio/gpio-grgpio.c    | 5 ++---
 drivers/gpio/gpio-lpc18xx.c   | 4 ++--
 drivers/gpio/gpio-mvebu.c     | 4 ++--
 drivers/gpio/gpio-mxc.c       | 4 ++--
 drivers/gpio/gpio-mxs.c       | 2 +-
 drivers/gpio/gpio-pxa.c       | 5 ++---
 drivers/gpio/gpio-rockchip.c  | 4 ++--
 drivers/gpio/gpio-sodaville.c | 4 ++--
 drivers/gpio/gpio-tb10x.c     | 5 ++---
 drivers/gpio/gpio-twl4030.c   | 2 +-
 13 files changed, 22 insertions(+), 28 deletions(-)
drivers/gpio/gpio-brcmstb.c +2 -4
index e7671bcd5c07..e29a9589b3cc 100644
@@ -436,10 +436,8 @@ static int brcmstb_gpio_irq_setup(struct platform_device *pdev,
 	struct device_node *np = dev->of_node;
 	int err;
 
-	priv->irq_domain =
-		irq_domain_create_linear(of_fwnode_handle(np), priv->num_gpios,
-				      &brcmstb_gpio_irq_domain_ops,
-				      priv);
+	priv->irq_domain = irq_domain_create_linear(dev_fwnode(dev), priv->num_gpios,
+						    &brcmstb_gpio_irq_domain_ops, priv);
 	if (!priv->irq_domain) {
 		dev_err(dev, "Couldn't allocate IRQ domain\n");
 		return -ENXIO;
drivers/gpio/gpio-davinci.c +1 -1
index 80a82492171e..8f3a36d0191d 100644
@@ -478,7 +478,7 @@ static int davinci_gpio_irq_setup(struct platform_device *pdev)
 			return irq;
 		}
 
-		irq_domain = irq_domain_create_legacy(of_fwnode_handle(dev->of_node), ngpio, irq, 0,
+		irq_domain = irq_domain_create_legacy(dev_fwnode(dev), ngpio, irq, 0,
 						      &davinci_gpio_irq_ops, chips);
 		if (!irq_domain) {
 			dev_err(dev, "Couldn't register an IRQ domain\n");
drivers/gpio/gpio-em.c +1 -2
index a5e6e446f39c..015f1ac32dd9 100644
@@ -325,8 +325,7 @@ static int em_gio_probe(struct platform_device *pdev)
 	irq_chip->irq_release_resources = em_gio_irq_relres;
 	irq_chip->flags	= IRQCHIP_SKIP_SET_WAKE | IRQCHIP_MASK_ON_SUSPEND;
 
-	p->irq_domain = irq_domain_create_simple(of_fwnode_handle(dev->of_node),
-						 ngpios, 0,
+	p->irq_domain = irq_domain_create_simple(dev_fwnode(dev), ngpios, 0,
 						 &em_gio_irq_domain_ops, p);
 	if (!p->irq_domain) {
 		dev_err(dev, "cannot initialize irq domain\n");
drivers/gpio/gpio-grgpio.c +2 -3
index d38a2d9854ca..f3f8bab62f94 100644
@@ -402,9 +402,8 @@ static int grgpio_probe(struct platform_device *ofdev)
 			return -EINVAL;
 		}
 
-		priv->domain = irq_domain_create_linear(of_fwnode_handle(np), gc->ngpio,
-						     &grgpio_irq_domain_ops,
-						     priv);
+		priv->domain = irq_domain_create_linear(dev_fwnode(&ofdev->dev), gc->ngpio,
+							&grgpio_irq_domain_ops, priv);
 		if (!priv->domain) {
 			dev_err(dev, "Could not add irq domain\n");
 			return -EINVAL;
drivers/gpio/gpio-lpc18xx.c +2 -2
index b0a8da5c058d..2dbfbf90176c 100644
@@ -249,8 +249,8 @@ static int lpc18xx_gpio_pin_ic_probe(struct lpc18xx_gpio_chip *gc)
 	raw_spin_lock_init(&ic->lock);
 
 	ic->domain = irq_domain_create_hierarchy(parent_domain, 0, NR_LPC18XX_GPIO_PIN_IC_IRQS,
-						 of_fwnode_handle(dev->of_node),
-						 &lpc18xx_gpio_pin_ic_domain_ops, ic);
+						 dev_fwnode(dev), &lpc18xx_gpio_pin_ic_domain_ops,
+						 ic);
 	if (!ic->domain) {
 		pr_err("unable to add irq domain\n");
 		ret = -ENODEV;
drivers/gpio/gpio-mvebu.c +2 -2
index 57633a7b4270..24792b8eb083 100644
@@ -1236,8 +1236,8 @@ static int mvebu_gpio_probe(struct platform_device *pdev)
 	if (!have_irqs)
 		return 0;
 
-	mvchip->domain =
-	    irq_domain_create_linear(of_fwnode_handle(np), ngpios, &irq_generic_chip_ops, NULL);
+	mvchip->domain = irq_domain_create_linear(dev_fwnode(&pdev->dev), ngpios,
+						  &irq_generic_chip_ops, NULL);
 	if (!mvchip->domain) {
 		dev_err(&pdev->dev, "couldn't allocate irq domain %s (DT).\n",
 			mvchip->chip.label);
drivers/gpio/gpio-mxc.c +2 -2
index fae1a30f8ae6..4af5a2972d12 100644
@@ -509,8 +509,8 @@ static int mxc_gpio_probe(struct platform_device *pdev)
 		goto out_bgio;
 	}
 
-	port->domain = irq_domain_create_legacy(of_fwnode_handle(np), 32, irq_base, 0,
-					     &irq_domain_simple_ops, NULL);
+	port->domain = irq_domain_create_legacy(dev_fwnode(&pdev->dev), 32, irq_base, 0,
+						&irq_domain_simple_ops, NULL);
 	if (!port->domain) {
 		err = -ENODEV;
 		goto out_bgio;
drivers/gpio/gpio-mxs.c +1 -1
index b418fbccb26c..0ea46f3d04e1 100644
@@ -303,7 +303,7 @@ static int mxs_gpio_probe(struct platform_device *pdev)
 		goto out_iounmap;
 	}
 
-	port->domain = irq_domain_create_legacy(of_fwnode_handle(np), 32, irq_base, 0,
+	port->domain = irq_domain_create_legacy(dev_fwnode(&pdev->dev), 32, irq_base, 0,
 						&irq_domain_simple_ops, NULL);
 	if (!port->domain) {
 		err = -ENODEV;
drivers/gpio/gpio-pxa.c +2 -3
index aead35ea090e..131ab79ebce7 100644
@@ -642,9 +642,8 @@ static int pxa_gpio_probe(struct platform_device *pdev)
 	if (!pxa_last_gpio)
 		return -EINVAL;
 
-	pchip->irqdomain = irq_domain_create_legacy(of_fwnode_handle(pdev->dev.of_node),
-						    pxa_last_gpio + 1, irq_base, 0,
-						    &pxa_irq_domain_ops, pchip);
+	pchip->irqdomain = irq_domain_create_legacy(dev_fwnode(&pdev->dev), pxa_last_gpio + 1,
+						    irq_base, 0, &pxa_irq_domain_ops, pchip);
 	if (!pchip->irqdomain)
 		return -ENOMEM;
 
drivers/gpio/gpio-rockchip.c +2 -2
index c63352f2f1ec..64700a003f9a 100644
@@ -521,8 +521,8 @@ static int rockchip_interrupts_register(struct rockchip_pin_bank *bank)
 	struct irq_chip_generic *gc;
 	int ret;
 
-	bank->domain = irq_domain_create_linear(of_fwnode_handle(bank->of_node), 32,
-					&irq_generic_chip_ops, NULL);
+	bank->domain = irq_domain_create_linear(dev_fwnode(bank->dev), 32, &irq_generic_chip_ops,
+						NULL);
 	if (!bank->domain) {
 		dev_warn(bank->dev, "could not init irq domain for bank %s\n",
 			 bank->name);
drivers/gpio/gpio-sodaville.c +2 -2
index 6a3c4c625138..abd13c79ace0 100644
@@ -169,8 +169,8 @@ static int sdv_register_irqsupport(struct sdv_gpio_chip_data *sd,
 			IRQ_GC_INIT_MASK_CACHE, IRQ_NOREQUEST,
 			IRQ_LEVEL | IRQ_NOPROBE);
 
-	sd->id = irq_domain_create_legacy(of_fwnode_handle(pdev->dev.of_node), SDV_NUM_PUB_GPIOS,
-				sd->irq_base, 0, &irq_domain_sdv_ops, sd);
+	sd->id = irq_domain_create_legacy(dev_fwnode(&pdev->dev), SDV_NUM_PUB_GPIOS, sd->irq_base,
+					  0, &irq_domain_sdv_ops, sd);
 	if (!sd->id)
 		return -ENODEV;
 
drivers/gpio/gpio-tb10x.c +2 -3
index 8cf676fd0a0b..1869ee7f9423 100644
@@ -183,9 +183,8 @@ static int tb10x_gpio_probe(struct platform_device *pdev)
 		if (ret != 0)
 			return ret;
 
-		tb10x_gpio->domain = irq_domain_create_linear(of_fwnode_handle(np),
-						tb10x_gpio->gc.ngpio,
-						&irq_generic_chip_ops, NULL);
+		tb10x_gpio->domain = irq_domain_create_linear(dev_fwnode(dev), tb10x_gpio->gc.ngpio,
+							      &irq_generic_chip_ops, NULL);
 		if (!tb10x_gpio->domain) {
 			return -ENOMEM;
 		}
drivers/gpio/gpio-twl4030.c +1 -1
index 0d17985a5fdc..c5d7825f19c1 100644
@@ -523,7 +523,7 @@ static int gpio_twl4030_probe(struct platform_device *pdev)
 		return irq_base;
 	}
 
-	irq_domain_create_legacy(of_fwnode_handle(pdev->dev.of_node), TWL4030_GPIO_MAX, irq_base, 0,
+	irq_domain_create_legacy(dev_fwnode(&pdev->dev), TWL4030_GPIO_MAX, irq_base, 0,
 				 &irq_domain_simple_ops, NULL);
 
 	ret = twl4030_sih_setup(&pdev->dev, TWL4030_MODULE_GPIO, irq_base);
Signature · 1 line
2.49.0
maintainer
#8 lore raw

Re: [PATCH] gpio: Use dev_fwnode()

Quoted 5 lines · Jiri Slaby (SUSE)

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.

Thanks for this change. See my nit-pick below.

...

drivers/gpio/gpio-brcmstb.c static int brcmstb_gpio_irq_setup(struct platform_device *pdev, · line 440

Quoted 10 lines
drivers/gpio/gpio-brcmstb.c +2 -4
@@ -436,10 +436,8 @@ static int brcmstb_gpio_irq_setup(struct platform_device *pdev,
 	struct device_node *np = dev->of_node;
 	int err;
 
-	priv->irq_domain =
-		irq_domain_create_linear(of_fwnode_handle(np), priv->num_gpios,
-				      &brcmstb_gpio_irq_domain_ops,
-				      priv);
+	priv->irq_domain = irq_domain_create_linear(dev_fwnode(dev), priv->num_gpios,
+						    &brcmstb_gpio_irq_domain_ops, priv);

In cases like this, I would rather see something like

	struct fwnode_handle *fwnode = dev_fwnode(dev);

just near to the respective of node extraction. This will help to reduce churn when converting the rest of the code to use fwnode instead of of_node/np.

drivers/gpio/gpio-brcmstb.c static int brcmstb_gpio_irq_setup(struct platform_device *pdev, · line 443

Quoted 3 lines
drivers/gpio/gpio-brcmstb.c +0 -0
 	if (!priv->irq_domain) {
 		dev_err(dev, "Couldn't allocate IRQ domain\n");
 		return -ENXIO;

Other than that I appreciate the series!

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#9 lore raw

Re: [PATCH] gpio: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

From: Bartosz Golaszewski <[email protected]>

Quoted 8 lines · Jiri Slaby (SUSE)

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.

[...]

Applied, thanks!

[1/1] gpio: Use dev_fwnode()

      https://git.kernel.org/brgl/linux/c/7b2c2f1eb3914f5214a5b2ae966d7d7bb0057582

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>
#10 lore raw

PATCH 1/1 gpu: ipu-v3: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

---
 drivers/gpu/ipu-v3/ipu-common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/ipu-v3/ipu-common.c +1 -1
index 333f36e0a715..521d7ec10d85 100644
@@ -1169,7 +1169,7 @@ static int ipu_irq_init(struct ipu_soc *ipu)
 	};
 	int ret, i;
 
-	ipu->domain = irq_domain_create_linear(of_fwnode_handle(ipu->dev->of_node), IPU_NUM_IRQS,
+	ipu->domain = irq_domain_create_linear(dev_fwnode(ipu->dev), IPU_NUM_IRQS,
 					       &irq_generic_chip_ops, ipu);
 	if (!ipu->domain) {
 		dev_err(ipu->dev, "failed to add irq domain\n");
Signature · 1 line
2.49.0
#11 lore raw

PATCH 1/1 i2c: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

---
 drivers/i2c/muxes/i2c-mux-pca954x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/i2c/muxes/i2c-mux-pca954x.c +1 -2
index 5bb26af0f532..b9f370c9f018 100644
@@ -442,8 +442,7 @@ static int pca954x_irq_setup(struct i2c_mux_core *muxc)
 
 	raw_spin_lock_init(&data->lock);
 
-	data->irq = irq_domain_create_linear(of_fwnode_handle(client->dev.of_node),
-					     data->chip->nchans,
+	data->irq = irq_domain_create_linear(dev_fwnode(&client->dev), data->chip->nchans,
 					     &irq_domain_simple_ops, data);
 	if (!data->irq)
 		return -ENODEV;
Signature · 1 line
2.49.0
#12 lore raw

Re: [PATCH] i2c: Use dev_fwnode()

Quoted 9 lines · Jiri Slaby (SUSE)

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.

Added "mux: pca954x:" to the header and applied to for-next, thanks!

#13 lore raw

PATCH 1/1 iio: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Maxime Coquelin <[email protected]>
Cc Alexandre Torgue <[email protected]>

---
Cc: [email protected]
Cc: [email protected]

---
 drivers/iio/adc/stm32-adc-core.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/iio/adc/stm32-adc-core.c +2 -5
index bd3458965bff..58b5838227aa 100644
@@ -407,7 +407,6 @@ static const struct irq_domain_ops stm32_adc_domain_ops = {
 static int stm32_adc_irq_probe(struct platform_device *pdev,
 			       struct stm32_adc_priv *priv)
 {
-	struct device_node *np = pdev->dev.of_node;
 	unsigned int i;
 
 	/*
@@ -421,10 +420,8 @@ static int stm32_adc_irq_probe(struct platform_device *pdev,
 			return priv->irq[i];
 	}
 
-	priv->domain = irq_domain_create_simple(of_fwnode_handle(np),
-						STM32_ADC_MAX_ADCS, 0,
-						&stm32_adc_domain_ops,
-						priv);
+	priv->domain = irq_domain_create_simple(dev_fwnode(&pdev->dev), STM32_ADC_MAX_ADCS, 0,
+						&stm32_adc_domain_ops, priv);
 	if (!priv->domain) {
 		dev_err(&pdev->dev, "Failed to add irq domain\n");
 		return -ENOMEM;
Signature · 1 line
2.49.0
reviewer
#14 lore raw

Re: [PATCH] iio: Use dev_fwnode()

Subject should be "iio: adc: stm32-adc: Use dev_fwnode()"

Quoted 6 lines · Jiri Slaby (SUSE)

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.

...

drivers/iio/adc/stm32-adc-core.c static int stm32_adc_irq_probe(struct platform_device *pdev, · line 424

Quoted 10 lines
drivers/iio/adc/stm32-adc-core.c +2 -4
@@ -421,10 +420,8 @@ static int stm32_adc_irq_probe(struct platform_device *pdev,
 			return priv->irq[i];
 	}
 
-	priv->domain = irq_domain_create_simple(of_fwnode_handle(np),
-						STM32_ADC_MAX_ADCS, 0,
-						&stm32_adc_domain_ops,
-						priv);
+	priv->domain = irq_domain_create_simple(dev_fwnode(&pdev->dev), STM32_ADC_MAX_ADCS, 0,
+						&stm32_adc_domain_ops, priv);

In the IIO subsystem, we still usually wrap at 80 characters so wouldn't want to unwrap the lines here.

Quoted 3 lines
drivers/iio/adc/stm32-adc-core.c +0 -0
 	if (!priv->domain) {
 		dev_err(&pdev->dev, "Failed to add irq domain\n");
 		return -ENOMEM;
#15 lore raw

PATCH v2 1/1 iio: adc: stm32-adc: Use dev_fwnode()

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.

Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Maxime Coquelin <[email protected]>
Cc Alexandre Torgue <[email protected]>

---
[v2]
* fix subject
* wrap to 80 chars

---
 drivers/iio/adc/stm32-adc-core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/iio/adc/stm32-adc-core.c +1 -2
index bd3458965bff..dea166c53369 100644
@@ -407,7 +407,6 @@ static const struct irq_domain_ops stm32_adc_domain_ops = {
 static int stm32_adc_irq_probe(struct platform_device *pdev,
 			       struct stm32_adc_priv *priv)
 {
-	struct device_node *np = pdev->dev.of_node;
 	unsigned int i;
 
 	/*
@@ -421,7 +420,7 @@ static int stm32_adc_irq_probe(struct platform_device *pdev,
 			return priv->irq[i];
 	}
 
-	priv->domain = irq_domain_create_simple(of_fwnode_handle(np),
+	priv->domain = irq_domain_create_simple(dev_fwnode(&pdev->dev),
 						STM32_ADC_MAX_ADCS, 0,
 						&stm32_adc_domain_ops,
 						priv);
Signature · 1 line
2.49.0
reviewer Reviewed-by on v2 1/1
#16 lore raw

Re: [PATCH v2] iio: adc: stm32-adc: Use dev_fwnode()

Quoted 15 lines · Jiri Slaby (SUSE)

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.

Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Maxime Coquelin <[email protected]>
Cc Alexandre Torgue <[email protected]>
Quoted 1 line

---

maintainer Applied
#17 lore raw

Re: [PATCH v2] iio: adc: stm32-adc: Use dev_fwnode()

Quoted 16 lines · On Fri, 13 Jun 2025 12:00:10 -0500 David Lechner <[email protected]> wrote:
Quoted 15 lines · Jiri Slaby (SUSE)

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.

Cc Jonathan Cameron <[email protected]>
Cc David Lechner <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Andy Shevchenko <[email protected]>
Cc Maxime Coquelin <[email protected]>
Cc Alexandre Torgue <[email protected]>
Quoted 4 lines
Quoted 1 line

---

Applied. Thanks

#18 lore raw

PATCH 1/1 irqchip: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

---
Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Gregory Clement <[email protected]>
Cc: Sebastian Hesselbarth <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Nishanth Menon <[email protected]>
Cc: Tero Kristo <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 drivers/irqchip/irq-imgpdc.c              | 2 +-
 drivers/irqchip/irq-imx-irqsteer.c        | 2 +-
 drivers/irqchip/irq-keystone.c            | 4 ++--
 drivers/irqchip/irq-mvebu-pic.c           | 2 +-
 drivers/irqchip/irq-pruss-intc.c          | 2 +-
 drivers/irqchip/irq-renesas-intc-irqpin.c | 6 ++----
 drivers/irqchip/irq-renesas-irqc.c        | 2 +-
 drivers/irqchip/irq-renesas-rza1.c        | 5 ++---
 drivers/irqchip/irq-renesas-rzg2l.c       | 5 ++---
 drivers/irqchip/irq-renesas-rzv2h.c       | 2 +-
 drivers/irqchip/irq-stm32mp-exti.c        | 4 +---
 drivers/irqchip/irq-ti-sci-inta.c         | 3 +--
 drivers/irqchip/irq-ti-sci-intr.c         | 3 +--
 drivers/irqchip/irq-ts4800.c              | 2 +-
 14 files changed, 18 insertions(+), 26 deletions(-)
drivers/irqchip/irq-imgpdc.c +1 -1
index f0410d5d7315..484a089e7f6d 100644
@@ -372,7 +372,7 @@ static int pdc_intc_probe(struct platform_device *pdev)
 	priv->syswake_irq = irq;
 
 	/* Set up an IRQ domain */
-	priv->domain = irq_domain_create_linear(of_fwnode_handle(node), 16, &irq_generic_chip_ops,
+	priv->domain = irq_domain_create_linear(dev_fwnode(&pdev->dev), 16, &irq_generic_chip_ops,
 					     priv);
 	if (unlikely(!priv->domain)) {
 		dev_err(&pdev->dev, "cannot add IRQ domain\n");
drivers/irqchip/irq-imx-irqsteer.c +1 -1
index 6dc9ac48fee5..bb2b09f528fd 100644
@@ -212,7 +212,7 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
 	/* steer all IRQs into configured channel */
 	writel_relaxed(BIT(data->channel), data->regs + CHANCTRL);
 
-	data->domain = irq_domain_create_linear(of_fwnode_handle(np), data->reg_num * 32,
+	data->domain = irq_domain_create_linear(dev_fwnode(&pdev->dev), data->reg_num * 32,
 					     &imx_irqsteer_domain_ops, data);
 	if (!data->domain) {
 		dev_err(&pdev->dev, "failed to create IRQ domain\n");
drivers/irqchip/irq-keystone.c +2 -2
index c9e902b7bf48..922fff09354f 100644
@@ -157,8 +157,8 @@ static int keystone_irq_probe(struct platform_device *pdev)
 	kirq->chip.irq_mask	= keystone_irq_setmask;
 	kirq->chip.irq_unmask	= keystone_irq_unmask;
 
-	kirq->irqd = irq_domain_create_linear(of_fwnode_handle(np), KEYSTONE_N_IRQ,
-					      &keystone_irq_ops, kirq);
+	kirq->irqd = irq_domain_create_linear(dev_fwnode(dev), KEYSTONE_N_IRQ, &keystone_irq_ops,
+					      kirq);
 	if (!kirq->irqd) {
 		dev_err(dev, "IRQ domain registration failed\n");
 		return -ENODEV;
drivers/irqchip/irq-mvebu-pic.c +1 -1
index 8db638aa21d2..cd8b73482b9f 100644
@@ -150,7 +150,7 @@ static int mvebu_pic_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	pic->domain = irq_domain_create_linear(of_fwnode_handle(node), PIC_MAX_IRQS,
+	pic->domain = irq_domain_create_linear(dev_fwnode(&pdev->dev), PIC_MAX_IRQS,
 					       &mvebu_pic_domain_ops, pic);
 	if (!pic->domain) {
 		dev_err(&pdev->dev, "Failed to allocate irq domain\n");
drivers/irqchip/irq-pruss-intc.c +1 -1
index 87a5813fd835..81078d56f38d 100644
@@ -555,7 +555,7 @@ static int pruss_intc_probe(struct platform_device *pdev)
 
 	mutex_init(&intc->lock);
 
-	intc->domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node), max_system_events,
+	intc->domain = irq_domain_create_linear(dev_fwnode(dev), max_system_events,
 						&pruss_intc_irq_domain_ops, intc);
 	if (!intc->domain)
 		return -ENOMEM;
drivers/irqchip/irq-renesas-intc-irqpin.c +2 -4
index 0959ed43b1a9..117b74b635ea 100644
@@ -513,10 +513,8 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 	irq_chip->irq_set_wake = intc_irqpin_irq_set_wake;
 	irq_chip->flags	= IRQCHIP_MASK_ON_SUSPEND;
 
-	p->irq_domain = irq_domain_create_simple(of_fwnode_handle(dev->of_node),
-						 nirqs, 0,
-						 &intc_irqpin_irq_domain_ops,
-						 p);
+	p->irq_domain = irq_domain_create_simple(dev_fwnode(dev), nirqs, 0,
+						 &intc_irqpin_irq_domain_ops, p);
 	if (!p->irq_domain) {
 		ret = -ENXIO;
 		dev_err(dev, "cannot initialize irq domain\n");
drivers/irqchip/irq-renesas-irqc.c +1 -1
index 5c3196e5a437..b46bbb66c264 100644
@@ -168,7 +168,7 @@ static int irqc_probe(struct platform_device *pdev)
 
 	p->cpu_int_base = p->iomem + IRQC_INT_CPU_BASE(0); /* SYS-SPI */
 
-	p->irq_domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node), p->number_of_irqs,
+	p->irq_domain = irq_domain_create_linear(dev_fwnode(dev), p->number_of_irqs,
 						 &irq_generic_chip_ops, p);
 	if (!p->irq_domain) {
 		ret = -ENXIO;
drivers/irqchip/irq-renesas-rza1.c +2 -3
index 0a9640ba0adb..a697eb55ac90 100644
@@ -231,9 +231,8 @@ static int rza1_irqc_probe(struct platform_device *pdev)
 	priv->chip.irq_set_type = rza1_irqc_set_type;
 	priv->chip.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE;
 
-	priv->irq_domain = irq_domain_create_hierarchy(parent, 0, IRQC_NUM_IRQ,
-						       of_fwnode_handle(np), &rza1_irqc_domain_ops,
-						       priv);
+	priv->irq_domain = irq_domain_create_hierarchy(parent, 0, IRQC_NUM_IRQ, dev_fwnode(dev),
+						       &rza1_irqc_domain_ops, priv);
 	if (!priv->irq_domain) {
 		dev_err(dev, "cannot initialize irq domain\n");
 		ret = -ENOMEM;
drivers/irqchip/irq-renesas-rzg2l.c +2 -3
index 1e861bd64f97..360d88687e4f 100644
@@ -574,9 +574,8 @@ static int rzg2l_irqc_common_init(struct device_node *node, struct device_node *
 
 	raw_spin_lock_init(&rzg2l_irqc_data->lock);
 
-	irq_domain = irq_domain_create_hierarchy(parent_domain, 0, IRQC_NUM_IRQ,
-						 of_fwnode_handle(node), &rzg2l_irqc_domain_ops,
-						 rzg2l_irqc_data);
+	irq_domain = irq_domain_create_hierarchy(parent_domain, 0, IRQC_NUM_IRQ, dev_fwnode(dev),
+						 &rzg2l_irqc_domain_ops, rzg2l_irqc_data);
 	if (!irq_domain) {
 		pm_runtime_put(dev);
 		return dev_err_probe(dev, -ENOMEM, "failed to add irq domain\n");
drivers/irqchip/irq-renesas-rzv2h.c +1 -1
index 69b32c19e8ff..57c5a3c008c9 100644
@@ -558,7 +558,7 @@ static int rzv2h_icu_init_common(struct device_node *node, struct device_node *p
 	raw_spin_lock_init(&rzv2h_icu_data->lock);
 
 	irq_domain = irq_domain_create_hierarchy(parent_domain, 0, ICU_NUM_IRQ,
-						 of_fwnode_handle(node), &rzv2h_icu_domain_ops,
+						 dev_fwnode(&pdev->dev), &rzv2h_icu_domain_ops,
 						 rzv2h_icu_data);
 	if (!irq_domain) {
 		dev_err(&pdev->dev, "failed to add irq domain\n");
drivers/irqchip/irq-stm32mp-exti.c +1 -3
index c6b4407d05f9..a24f4f1a4f8f 100644
@@ -683,9 +683,7 @@ static int stm32mp_exti_probe(struct platform_device *pdev)
 	}
 
 	domain = irq_domain_create_hierarchy(parent_domain, 0, drv_data->bank_nr * IRQS_PER_BANK,
-					     of_fwnode_handle(np), &stm32mp_exti_domain_ops,
-					     host_data);
-
+					     dev_fwnode(dev), &stm32mp_exti_domain_ops, host_data);
 	if (!domain) {
 		dev_err(dev, "Could not register exti domain\n");
 		return -ENOMEM;
drivers/irqchip/irq-ti-sci-inta.c +1 -2
index 7de59238e6b0..01963d36cfaf 100644
@@ -701,8 +701,7 @@ static int ti_sci_inta_irq_domain_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	domain = irq_domain_create_linear(of_fwnode_handle(dev_of_node(dev)),
-					  ti_sci_get_num_resources(inta->vint),
+	domain = irq_domain_create_linear(dev_fwnode(dev), ti_sci_get_num_resources(inta->vint),
 					  &ti_sci_inta_irq_domain_ops, inta);
 	if (!domain) {
 		dev_err(dev, "Failed to allocate IRQ domain\n");
drivers/irqchip/irq-ti-sci-intr.c +1 -2
index 07fff5ae5ce0..354613e74ad0 100644
@@ -274,8 +274,7 @@ static int ti_sci_intr_irq_domain_probe(struct platform_device *pdev)
 		return PTR_ERR(intr->out_irqs);
 	}
 
-	domain = irq_domain_create_hierarchy(parent_domain, 0, 0,
-					     of_fwnode_handle(dev_of_node(dev)),
+	domain = irq_domain_create_hierarchy(parent_domain, 0, 0, dev_fwnode(dev),
 					     &ti_sci_intr_irq_domain_ops, intr);
 	if (!domain) {
 		dev_err(dev, "Failed to allocate IRQ domain\n");
drivers/irqchip/irq-ts4800.c +1 -1
index e625f4fb2bb8..1e236d5b7516 100644
@@ -125,7 +125,7 @@ static int ts4800_ic_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	data->domain = irq_domain_create_linear(of_fwnode_handle(node), 8, &ts4800_ic_ops, data);
+	data->domain = irq_domain_create_linear(dev_fwnode(&pdev->dev), 8, &ts4800_ic_ops, data);
 	if (!data->domain) {
 		dev_err(&pdev->dev, "cannot add IRQ domain\n");
 		return -ENOMEM;
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#19 lore raw

Re: [Linux-stm32] [PATCH] irqchip: Use dev_fwnode()

Quoted 29 lines · Jiri Slaby (SUSE)

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.

---
Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Gregory Clement <[email protected]>
Cc: Sebastian Hesselbarth <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Nishanth Menon <[email protected]>
Cc: Tero Kristo <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
 drivers/irqchip/irq-imgpdc.c              | 2 +- drivers/irqchip/irq-imx-irqsteer.c        | 2 +- drivers/irqchip/irq-keystone.c            | 4 ++--

Quoted 8 lines

 drivers/irqchip/irq-mvebu-pic.c           | 2 +- drivers/irqchip/irq-pruss-intc.c          | 2 +- drivers/irqchip/irq-renesas-intc-irqpin.c | 6 ++---- drivers/irqchip/irq-renesas-irqc.c        | 2 +- drivers/irqchip/irq-renesas-rza1.c        | 5 ++--- drivers/irqchip/irq-renesas-rzg2l.c       | 5 ++--- drivers/irqchip/irq-renesas-rzv2h.c       | 2 +- drivers/irqchip/irq-stm32mp-exti.c        | 4 +---

For drivers/irqchip/irq-stm32mp-exti.c

Thanks
Antonio

#20 lore raw

[tip: irq/drivers] irqchip: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)
The following commit has been merged into the irq/drivers branch of tip:

The following commit has been merged into the irq/drivers branch of tip:

Commit-ID:     93174c05dd2e9b02eb6b5c93dd9109087ae4ffcf
Gitweb:        https://git.kernel.org/tip/93174c05dd2e9b02eb6b5c93dd9109087ae4ffcf
Author:        Jiri Slaby (SUSE) <[email protected]>
AuthorDate:    Wed, 11 Jun 2025 12:43:38 +02:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Thu, 12 Jun 2025 15:08:12 +02:00

irqchip: Use dev_fwnode()

irq_domain_create_simple() takes a fwnode as the first argument. It can be extracted from struct device using the dev_fwnode() helper instead of using of_node with of_fwnode_handle().

So use the dev_fwnode() helper.

---
 drivers/irqchip/irq-imgpdc.c              | 4 ++--
 drivers/irqchip/irq-imx-irqsteer.c        | 4 ++--
 drivers/irqchip/irq-keystone.c            | 4 ++--
 drivers/irqchip/irq-mvebu-pic.c           | 2 +-
 drivers/irqchip/irq-pruss-intc.c          | 2 +-
 drivers/irqchip/irq-renesas-intc-irqpin.c | 6 ++----
 drivers/irqchip/irq-renesas-irqc.c        | 2 +-
 drivers/irqchip/irq-renesas-rza1.c        | 5 ++---
 drivers/irqchip/irq-renesas-rzg2l.c       | 5 ++---
 drivers/irqchip/irq-renesas-rzv2h.c       | 2 +-
 drivers/irqchip/irq-stm32mp-exti.c        | 4 +---
 drivers/irqchip/irq-ti-sci-inta.c         | 3 +--
 drivers/irqchip/irq-ti-sci-intr.c         | 3 +--
 drivers/irqchip/irq-ts4800.c              | 2 +-
 14 files changed, 20 insertions(+), 28 deletions(-)
drivers/irqchip/irq-imgpdc.c +2 -2
index f0410d5..e9ef2f5 100644
@@ -372,8 +372,8 @@ static int pdc_intc_probe(struct platform_device *pdev)
 	priv->syswake_irq = irq;
 
 	/* Set up an IRQ domain */
-	priv->domain = irq_domain_create_linear(of_fwnode_handle(node), 16, &irq_generic_chip_ops,
-					     priv);
+	priv->domain = irq_domain_create_linear(dev_fwnode(&pdev->dev), 16, &irq_generic_chip_ops,
+						priv);
 	if (unlikely(!priv->domain)) {
 		dev_err(&pdev->dev, "cannot add IRQ domain\n");
 		return -ENOMEM;
drivers/irqchip/irq-imx-irqsteer.c +2 -2
index 6dc9ac4..4682ce5 100644
@@ -212,8 +212,8 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
 	/* steer all IRQs into configured channel */
 	writel_relaxed(BIT(data->channel), data->regs + CHANCTRL);
 
-	data->domain = irq_domain_create_linear(of_fwnode_handle(np), data->reg_num * 32,
-					     &imx_irqsteer_domain_ops, data);
+	data->domain = irq_domain_create_linear(dev_fwnode(&pdev->dev), data->reg_num * 32,
+						&imx_irqsteer_domain_ops, data);
 	if (!data->domain) {
 		dev_err(&pdev->dev, "failed to create IRQ domain\n");
 		ret = -ENOMEM;
drivers/irqchip/irq-keystone.c +2 -2
index c9e902b..922fff0 100644
@@ -157,8 +157,8 @@ static int keystone_irq_probe(struct platform_device *pdev)
 	kirq->chip.irq_mask	= keystone_irq_setmask;
 	kirq->chip.irq_unmask	= keystone_irq_unmask;
 
-	kirq->irqd = irq_domain_create_linear(of_fwnode_handle(np), KEYSTONE_N_IRQ,
-					      &keystone_irq_ops, kirq);
+	kirq->irqd = irq_domain_create_linear(dev_fwnode(dev), KEYSTONE_N_IRQ, &keystone_irq_ops,
+					      kirq);
 	if (!kirq->irqd) {
 		dev_err(dev, "IRQ domain registration failed\n");
 		return -ENODEV;
drivers/irqchip/irq-mvebu-pic.c +1 -1
index 8db638a..cd8b734 100644
@@ -150,7 +150,7 @@ static int mvebu_pic_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	pic->domain = irq_domain_create_linear(of_fwnode_handle(node), PIC_MAX_IRQS,
+	pic->domain = irq_domain_create_linear(dev_fwnode(&pdev->dev), PIC_MAX_IRQS,
 					       &mvebu_pic_domain_ops, pic);
 	if (!pic->domain) {
 		dev_err(&pdev->dev, "Failed to allocate irq domain\n");
drivers/irqchip/irq-pruss-intc.c +1 -1
index 87a5813..81078d5 100644
@@ -555,7 +555,7 @@ static int pruss_intc_probe(struct platform_device *pdev)
 
 	mutex_init(&intc->lock);
 
-	intc->domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node), max_system_events,
+	intc->domain = irq_domain_create_linear(dev_fwnode(dev), max_system_events,
 						&pruss_intc_irq_domain_ops, intc);
 	if (!intc->domain)
 		return -ENOMEM;
drivers/irqchip/irq-renesas-intc-irqpin.c +2 -4
index 0959ed4..117b74b 100644
@@ -513,10 +513,8 @@ static int intc_irqpin_probe(struct platform_device *pdev)
 	irq_chip->irq_set_wake = intc_irqpin_irq_set_wake;
 	irq_chip->flags	= IRQCHIP_MASK_ON_SUSPEND;
 
-	p->irq_domain = irq_domain_create_simple(of_fwnode_handle(dev->of_node),
-						 nirqs, 0,
-						 &intc_irqpin_irq_domain_ops,
-						 p);
+	p->irq_domain = irq_domain_create_simple(dev_fwnode(dev), nirqs, 0,
+						 &intc_irqpin_irq_domain_ops, p);
 	if (!p->irq_domain) {
 		ret = -ENXIO;
 		dev_err(dev, "cannot initialize irq domain\n");
drivers/irqchip/irq-renesas-irqc.c +1 -1
index 5c3196e..b46bbb6 100644
@@ -168,7 +168,7 @@ static int irqc_probe(struct platform_device *pdev)
 
 	p->cpu_int_base = p->iomem + IRQC_INT_CPU_BASE(0); /* SYS-SPI */
 
-	p->irq_domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node), p->number_of_irqs,
+	p->irq_domain = irq_domain_create_linear(dev_fwnode(dev), p->number_of_irqs,
 						 &irq_generic_chip_ops, p);
 	if (!p->irq_domain) {
 		ret = -ENXIO;
drivers/irqchip/irq-renesas-rza1.c +2 -3
index 0a9640b..a697eb5 100644
@@ -231,9 +231,8 @@ static int rza1_irqc_probe(struct platform_device *pdev)
 	priv->chip.irq_set_type = rza1_irqc_set_type;
 	priv->chip.flags = IRQCHIP_MASK_ON_SUSPEND | IRQCHIP_SKIP_SET_WAKE;
 
-	priv->irq_domain = irq_domain_create_hierarchy(parent, 0, IRQC_NUM_IRQ,
-						       of_fwnode_handle(np), &rza1_irqc_domain_ops,
-						       priv);
+	priv->irq_domain = irq_domain_create_hierarchy(parent, 0, IRQC_NUM_IRQ, dev_fwnode(dev),
+						       &rza1_irqc_domain_ops, priv);
 	if (!priv->irq_domain) {
 		dev_err(dev, "cannot initialize irq domain\n");
 		ret = -ENOMEM;
drivers/irqchip/irq-renesas-rzg2l.c +2 -3
index 1e861bd..360d886 100644
@@ -574,9 +574,8 @@ static int rzg2l_irqc_common_init(struct device_node *node, struct device_node *
 
 	raw_spin_lock_init(&rzg2l_irqc_data->lock);
 
-	irq_domain = irq_domain_create_hierarchy(parent_domain, 0, IRQC_NUM_IRQ,
-						 of_fwnode_handle(node), &rzg2l_irqc_domain_ops,
-						 rzg2l_irqc_data);
+	irq_domain = irq_domain_create_hierarchy(parent_domain, 0, IRQC_NUM_IRQ, dev_fwnode(dev),
+						 &rzg2l_irqc_domain_ops, rzg2l_irqc_data);
 	if (!irq_domain) {
 		pm_runtime_put(dev);
 		return dev_err_probe(dev, -ENOMEM, "failed to add irq domain\n");
drivers/irqchip/irq-renesas-rzv2h.c +1 -1
index 69b32c1..57c5a3c 100644
@@ -558,7 +558,7 @@ static int rzv2h_icu_init_common(struct device_node *node, struct device_node *p
 	raw_spin_lock_init(&rzv2h_icu_data->lock);
 
 	irq_domain = irq_domain_create_hierarchy(parent_domain, 0, ICU_NUM_IRQ,
-						 of_fwnode_handle(node), &rzv2h_icu_domain_ops,
+						 dev_fwnode(&pdev->dev), &rzv2h_icu_domain_ops,
 						 rzv2h_icu_data);
 	if (!irq_domain) {
 		dev_err(&pdev->dev, "failed to add irq domain\n");
drivers/irqchip/irq-stm32mp-exti.c +1 -3
index c6b4407..a24f4f1 100644
@@ -683,9 +683,7 @@ static int stm32mp_exti_probe(struct platform_device *pdev)
 	}
 
 	domain = irq_domain_create_hierarchy(parent_domain, 0, drv_data->bank_nr * IRQS_PER_BANK,
-					     of_fwnode_handle(np), &stm32mp_exti_domain_ops,
-					     host_data);
-
+					     dev_fwnode(dev), &stm32mp_exti_domain_ops, host_data);
 	if (!domain) {
 		dev_err(dev, "Could not register exti domain\n");
 		return -ENOMEM;
drivers/irqchip/irq-ti-sci-inta.c +1 -2
index 7de5923..01963d3 100644
@@ -701,8 +701,7 @@ static int ti_sci_inta_irq_domain_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	domain = irq_domain_create_linear(of_fwnode_handle(dev_of_node(dev)),
-					  ti_sci_get_num_resources(inta->vint),
+	domain = irq_domain_create_linear(dev_fwnode(dev), ti_sci_get_num_resources(inta->vint),
 					  &ti_sci_inta_irq_domain_ops, inta);
 	if (!domain) {
 		dev_err(dev, "Failed to allocate IRQ domain\n");
drivers/irqchip/irq-ti-sci-intr.c +1 -2
index 07fff5a..354613e 100644
@@ -274,8 +274,7 @@ static int ti_sci_intr_irq_domain_probe(struct platform_device *pdev)
 		return PTR_ERR(intr->out_irqs);
 	}
 
-	domain = irq_domain_create_hierarchy(parent_domain, 0, 0,
-					     of_fwnode_handle(dev_of_node(dev)),
+	domain = irq_domain_create_hierarchy(parent_domain, 0, 0, dev_fwnode(dev),
 					     &ti_sci_intr_irq_domain_ops, intr);
 	if (!domain) {
 		dev_err(dev, "Failed to allocate IRQ domain\n");
drivers/irqchip/irq-ts4800.c +1 -1
index e625f4f..1e236d5 100644
@@ -125,7 +125,7 @@ static int ts4800_ic_probe(struct platform_device *pdev)
 		return -EINVAL;
 	}
 
-	data->domain = irq_domain_create_linear(of_fwnode_handle(node), 8, &ts4800_ic_ops, data);
+	data->domain = irq_domain_create_linear(dev_fwnode(&pdev->dev), 8, &ts4800_ic_ops, data);
 	if (!data->domain) {
 		dev_err(&pdev->dev, "cannot add IRQ domain\n");
 		return -ENOMEM;
maintainer Reviewed-by on v1 1/1
#21 lore raw

Re: [PATCH] irqchip: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)
Quoted 42 lines · Jiri Slaby (SUSE)

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.

---
Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Andrew Lunn <[email protected]>
Cc: Gregory Clement <[email protected]>
Cc: Sebastian Hesselbarth <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Nishanth Menon <[email protected]>
Cc: Tero Kristo <[email protected]>
Cc: Santosh Shilimkar <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 drivers/irqchip/irq-imgpdc.c              | 2 +-
 drivers/irqchip/irq-imx-irqsteer.c        | 2 +-
 drivers/irqchip/irq-keystone.c            | 4 ++--
 drivers/irqchip/irq-mvebu-pic.c           | 2 +-
 drivers/irqchip/irq-pruss-intc.c          | 2 +-
 drivers/irqchip/irq-renesas-intc-irqpin.c | 6 ++----
 drivers/irqchip/irq-renesas-irqc.c        | 2 +-
 drivers/irqchip/irq-renesas-rza1.c        | 5 ++---
 drivers/irqchip/irq-renesas-rzg2l.c       | 5 ++---
 drivers/irqchip/irq-renesas-rzv2h.c       | 2 +-
 drivers/irqchip/irq-stm32mp-exti.c        | 4 +---
 drivers/irqchip/irq-ti-sci-inta.c         | 3 +--
 drivers/irqchip/irq-ti-sci-intr.c         | 3 +--
 drivers/irqchip/irq-ts4800.c              | 2 +-
 14 files changed, 18 insertions(+), 26 deletions(-)

[..]

Quoted 19 lines
drivers/irqchip/irq-ti-sci-inta.c +1 -2
index 7de59238e6b0..01963d36cfaf 100644
@@ -701,8 +701,7 @@ static int ti_sci_inta_irq_domain_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	domain = irq_domain_create_linear(of_fwnode_handle(dev_of_node(dev)),
-					  ti_sci_get_num_resources(inta->vint),
+	domain = irq_domain_create_linear(dev_fwnode(dev), ti_sci_get_num_resources(inta->vint),
 					  &ti_sci_inta_irq_domain_ops, inta);
 	if (!domain) {
 		dev_err(dev, "Failed to allocate IRQ domain\n");
drivers/irqchip/irq-ti-sci-intr.c +0 -0
index 07fff5ae5ce0..354613e74ad0 100644

drivers/irqchip/irq-ti-sci-intr.c static int ti_sci_intr_irq_domain_probe(struct platform_device *pdev) · line 280

Quoted 9 lines
drivers/irqchip/irq-ti-sci-intr.c +1 -2
@@ -274,8 +274,7 @@ static int ti_sci_intr_irq_domain_probe(struct platform_device *pdev)
 		return PTR_ERR(intr->out_irqs);
 	}
 
-	domain = irq_domain_create_hierarchy(parent_domain, 0, 0,
-					     of_fwnode_handle(dev_of_node(dev)),
+	domain = irq_domain_create_hierarchy(parent_domain, 0, 0, dev_fwnode(dev),
 					     &ti_sci_intr_irq_domain_ops, intr);
 	if (!domain) {
 		dev_err(dev, "Failed to allocate IRQ domain\n");

[..]
For the ti-sci irqchip drivers:

Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#22 lore raw

PATCH 1/1 mailbox: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

Cc Manivannan Sadhasivam <[email protected]>
Cc Jassi Brar <[email protected]>

---
Cc: [email protected]

---
 drivers/mailbox/qcom-ipcc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/mailbox/qcom-ipcc.c +1 -2
index ea44ffb5ce1a..d957d989c0ce 100644
@@ -312,8 +312,7 @@ static int qcom_ipcc_probe(struct platform_device *pdev)
 	if (!name)
 		return -ENOMEM;
 
-	ipcc->irq_domain = irq_domain_create_tree(of_fwnode_handle(pdev->dev.of_node),
-						  &qcom_ipcc_irq_ops, ipcc);
+	ipcc->irq_domain = irq_domain_create_tree(dev_fwnode(&pdev->dev), &qcom_ipcc_irq_ops, ipcc);
 	if (!ipcc->irq_domain)
 		return -ENOMEM;
 
Signature · 1 line
2.49.0
#23 lore raw

PATCH 1/1 memory: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

Cc Roger Quadros <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>
---
 drivers/memory/omap-gpmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/memory/omap-gpmc.c +2 -2
index 9c96eed00194..d9e13c1f9b13 100644
@@ -1455,8 +1455,8 @@ static int gpmc_setup_irq(struct gpmc_device *gpmc)
 	gpmc->irq_chip.irq_unmask = gpmc_irq_unmask;
 	gpmc->irq_chip.irq_set_type = gpmc_irq_set_type;
 
-	gpmc_irq_domain = irq_domain_create_linear(of_fwnode_handle(gpmc->dev->of_node),
-						   gpmc->nirqs, &gpmc_irq_domain_ops, gpmc);
+	gpmc_irq_domain = irq_domain_create_linear(dev_fwnode(gpmc->dev), gpmc->nirqs,
+						   &gpmc_irq_domain_ops, gpmc);
 	if (!gpmc_irq_domain) {
 		dev_err(gpmc->dev, "IRQ domain add failed\n");
 		return -ENODEV;
Signature · 1 line
2.49.0
#24 lore raw

Re: [PATCH] memory: Use dev_fwnode()

Quoted 4 lines · Jiri Slaby (SUSE)

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().

Quoted 8 lines

So use the dev_fwnode() helper.

Cc Roger Quadros <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>

---

Please send patches standard way, so without fake in-reply-to. b4 shazam on entire patchset (because this is not a continuation - see subject prefix) grabs entirely wrong patch:

-----------------
Grabbing thread from lore.kernel.org/all/[email protected]/t.mbox.gz Breaking thread to remove parents of [email protected]
Checking for newer revisions
Grabbing search results from lore.kernel.org
Added from v2: 1 patches
Analyzing 10 messages in the thread
Analyzing 19 code-review messages
Will use the latest revision: v2
You can pick other revisions using the -vN flag
Checking attestation on all messages, may take a moment...
---
✓ [PATCH v2] iio: adc: stm32-adc: Use dev_fwnode()
+ Link:
https://lore.kernel.org/r/[email protected]
-----------------

Applying single patch also fails:

-----------------
Grabbing thread from lore.kernel.org/all/[email protected]/t.mbox.gz Checking for newer revisions
Grabbing search results from lore.kernel.org
Added from v2: 1 patches
Analyzing 10 messages in the thread
Analyzing 19 code-review messages
Will use the latest revision: v2
You can pick other revisions using the -vN flag
Specified msgid is not present in the series, cannot cherrypick
-----------------

Best regards,
Krzysztof

#25 lore raw

Re: [PATCH] memory: Use dev_fwnode()

Quoted 39 lines · Krzysztof Kozlowski
Quoted 4 lines · Jiri Slaby (SUSE)

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().

Quoted 8 lines

So use the dev_fwnode() helper.

Cc Roger Quadros <[email protected]>
Cc Tony Lindgren <[email protected]>
Cc Krzysztof Kozlowski <[email protected]>

---

Please send patches standard way, so without fake in-reply-to. b4 shazam on entire patchset (because this is not a continuation - see subject prefix) grabs entirely wrong patch:

-----------------
Grabbing thread from lore.kernel.org/all/[email protected]/t.mbox.gz Breaking thread to remove parents of [email protected]
Checking for newer revisions
Grabbing search results from lore.kernel.org
Added from v2: 1 patches
Analyzing 10 messages in the thread
Analyzing 19 code-review messages
Will use the latest revision: v2
You can pick other revisions using the -vN flag
Checking attestation on all messages, may take a moment...
---
✓ [PATCH v2] iio: adc: stm32-adc: Use dev_fwnode()
+ Link:
https://lore.kernel.org/r/[email protected]
-----------------

Applying single patch also fails:

Quoted 12 lines

-----------------
Grabbing thread from lore.kernel.org/all/[email protected]/t.mbox.gz Checking for newer revisions
Grabbing search results from lore.kernel.org
Added from v2: 1 patches
Analyzing 10 messages in the thread
Analyzing 19 code-review messages
Will use the latest revision: v2
You can pick other revisions using the -vN flag
Specified msgid is not present in the series, cannot cherrypick
-----------------

ok, -v1 helped, but this entire dance could be avoided if you sent it standard way, without confusing threading and attaching on patch to something else.

Best regards,
Krzysztof

#26 lore raw

Re: [PATCH] memory: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)
Quoted 8 lines · Jiri Slaby (SUSE)

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.

[...]

Applied, thanks!

[1/1] memory: Use dev_fwnode()

      https://git.kernel.org/krzk/linux-mem-ctrl/c/a0be20055d41028a121a5acc140e17c73d7541c5

Best regards,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>
#27 lore raw

PATCH 1/1 mfd: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

---
Cc: Linus Walleij <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Sascha Hauer <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Matthias Brugger <[email protected]>
Cc: AngeloGioacchino Del Regno <[email protected]>
Cc: Maxime Coquelin <[email protected]>
Cc: Alexandre Torgue <[email protected]>
Cc: Aaro Koskinen <[email protected]>
Cc: Andreas Kemnade <[email protected]>
Cc: Kevin Hilman <[email protected]>
Cc: Roger Quadros <[email protected]>
Cc: Tony Lindgren <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]

---
 drivers/mfd/ab8500-core.c     |  3 +--
 drivers/mfd/fsl-imx25-tsadc.c |  4 ++--
 drivers/mfd/lp8788-irq.c      |  2 +-
 drivers/mfd/mt6358-irq.c      |  3 +--
 drivers/mfd/mt6397-irq.c      |  4 ++--
 drivers/mfd/qcom-pm8xxx.c     |  4 ++--
 drivers/mfd/stmfx.c           |  5 ++---
 drivers/mfd/tps65217.c        |  4 ++--
 drivers/mfd/tps6586x.c        |  6 +++---
 drivers/mfd/twl6030-irq.c     |  5 ++---
 drivers/mfd/wm831x-irq.c      | 10 ++++------
 11 files changed, 22 insertions(+), 28 deletions(-)
drivers/mfd/ab8500-core.c +1 -2
index 049abcbd71ce..f0bc0b5a6f4a 100644
@@ -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) {
drivers/mfd/fsl-imx25-tsadc.c +2 -2
index d47152467951..0aab6428e042 100644
@@ -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;
drivers/mfd/lp8788-irq.c +1 -1
index ea0fdf7a4b6e..f62fa2d7f010 100644
@@ -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");
drivers/mfd/mt6358-irq.c +1 -2
index 9f0bcc3ad7a1..f467b00d2366 100644
@@ -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");
drivers/mfd/mt6397-irq.c +2 -2
index badc614b4345..0e463026c5a9 100644
@@ -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;
drivers/mfd/qcom-pm8xxx.c +2 -2
index c96ea6fbede8..1149f7102a36 100644
@@ -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;
 
drivers/mfd/stmfx.c +2 -3
index 823b1d29389e..f683fdb6ece6 100644
@@ -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;
drivers/mfd/tps65217.c +2 -2
index 4e9669d327b4..c240fac0ede7 100644
@@ -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;
drivers/mfd/tps6586x.c +3 -3
index 853c48286071..8d5fe2b60bfa 100644
@@ -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;
drivers/mfd/twl6030-irq.c +2 -3
index 00b14cef1dfb..df87b5168ae9 100644
@@ -410,9 +410,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;
drivers/mfd/wm831x-irq.c +4 -6
index b3883fa5dd9f..defd5f173eb6 100644
@@ -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");
Signature · 1 line
2.49.0
Reviewed-by on v1 1/1
#28 lore raw

Re: [PATCH] mfd: Use dev_fwnode()

Quoted 10 lines · Jiri Slaby (SUSE)

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.

---

For wm831x:

Thanks,
Charles

maintainer Applied
#29 lore raw

Re: (subset) [PATCH] mfd: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)
Quoted 8 lines · Jiri Slaby (SUSE)

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.

[...]

Applied, thanks!

[1/1] mfd: Use dev_fwnode()

      commit: 0cfe69476ebf3a27b074848f2a147ae22c2d84fc

--
Lee Jones [李琼斯]

#30 lore raw

PATCH 1/1 misc: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

Cc Arnd Bergmann <[email protected]>
Cc Greg Kroah-Hartman <[email protected]>
---
 drivers/misc/hi6421v600-irq.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/misc/hi6421v600-irq.c +1 -3
index 187c5bc91e31..5ba40222eb12 100644
@@ -214,7 +214,6 @@ static void hi6421v600_irq_init(struct hi6421v600_irq *priv)
 static int hi6421v600_irq_probe(struct platform_device *pdev)
 {
 	struct device *pmic_dev = pdev->dev.parent;
-	struct device_node *np = pmic_dev->of_node;
 	struct platform_device *pmic_pdev;
 	struct device *dev = &pdev->dev;
 	struct hi6421v600_irq *priv;
@@ -254,8 +253,7 @@ static int hi6421v600_irq_probe(struct platform_device *pdev)
 	if (!priv->irqs)
 		return -ENOMEM;
 
-	priv->domain = irq_domain_create_simple(of_fwnode_handle(np),
-						PMIC_IRQ_LIST_MAX, 0,
+	priv->domain = irq_domain_create_simple(dev_fwnode(pmic_dev), PMIC_IRQ_LIST_MAX, 0,
 						&hi6421v600_domain_ops, priv);
 	if (!priv->domain) {
 		dev_err(dev, "Failed to create IRQ domain\n");
Signature · 1 line
2.49.0
#31 lore raw

PATCH 1/1 net: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

---
Cc: Woojung Huh <[email protected]>
Cc: [email protected]
Cc: Andrew Lunn <[email protected]>
Cc: Vladimir Oltean <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: Thangaraj Samynathan <[email protected]>
Cc: Rengarajan Sundararajan <[email protected]>
Cc: Richard Cochran <[email protected]>
Cc: [email protected]

---
 drivers/net/dsa/microchip/ksz_common.c | 3 +--
 drivers/net/dsa/microchip/ksz_ptp.c    | 4 ++--
 drivers/net/dsa/mv88e6xxx/global2.c    | 6 ++----
 drivers/net/dsa/qca/ar9331.c           | 4 ++--
 drivers/net/usb/lan78xx.c              | 6 ++----
 5 files changed, 9 insertions(+), 14 deletions(-)
drivers/net/dsa/microchip/ksz_common.c +1 -2
index 7c142c17b3f6..6e1daf0018bc 100644
@@ -2786,8 +2786,7 @@ static int ksz_irq_common_setup(struct ksz_device *dev, struct ksz_irq *kirq)
 	kirq->dev = dev;
 	kirq->masked = ~0;
 
-	kirq->domain = irq_domain_create_simple(of_fwnode_handle(dev->dev->of_node),
-						kirq->nirqs, 0,
+	kirq->domain = irq_domain_create_simple(dev_fwnode(dev->dev), kirq->nirqs, 0,
 						&ksz_irq_domain_ops, kirq);
 	if (!kirq->domain)
 		return -ENOMEM;
drivers/net/dsa/microchip/ksz_ptp.c +2 -2
index 8ab664e85f13..35fc21b1ee48 100644
@@ -1130,8 +1130,8 @@ int ksz_ptp_irq_setup(struct dsa_switch *ds, u8 p)
 
 	init_completion(&port->tstamp_msg_comp);
 
-	ptpirq->domain = irq_domain_create_linear(of_fwnode_handle(dev->dev->of_node),
-						  ptpirq->nirqs, &ksz_ptp_irq_domain_ops, ptpirq);
+	ptpirq->domain = irq_domain_create_linear(dev_fwnode(dev->dev), ptpirq->nirqs,
+						  &ksz_ptp_irq_domain_ops, ptpirq);
 	if (!ptpirq->domain)
 		return -ENOMEM;
 
drivers/net/dsa/mv88e6xxx/global2.c +2 -4
index aaf97c1e3167..30a6ffa7817b 100644
@@ -1154,10 +1154,8 @@ int mv88e6xxx_g2_irq_setup(struct mv88e6xxx_chip *chip)
 	if (err)
 		return err;
 
-	chip->g2_irq.domain = irq_domain_create_simple(of_fwnode_handle(chip->dev->of_node),
-						       16, 0,
-						       &mv88e6xxx_g2_irq_domain_ops,
-						       chip);
+	chip->g2_irq.domain = irq_domain_create_simple(dev_fwnode(chip->dev), 16, 0,
+						       &mv88e6xxx_g2_irq_domain_ops, chip);
 	if (!chip->g2_irq.domain)
 		return -ENOMEM;
 
drivers/net/dsa/qca/ar9331.c +2 -2
index 79a29676ca6f..0526aa96146e 100644
@@ -821,8 +821,8 @@ static int ar9331_sw_irq_init(struct ar9331_sw_priv *priv)
 		return ret;
 	}
 
-	priv->irqdomain = irq_domain_create_linear(of_fwnode_handle(np), 1,
-						   &ar9331_sw_irqdomain_ops, priv);
+	priv->irqdomain = irq_domain_create_linear(dev_fwnode(dev), 1, &ar9331_sw_irqdomain_ops,
+						   priv);
 	if (!priv->irqdomain) {
 		dev_err(dev, "failed to create IRQ domain\n");
 		return -EINVAL;
drivers/net/usb/lan78xx.c +2 -4
index f53e255116ea..391a497bbd20 100644
@@ -2448,10 +2448,8 @@ 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_create_simple(of_fwnode_handle(dev->udev->dev.parent->of_node),
-					     MAX_INT_EP, 0,
-					     &chip_domain_ops,
-					     &dev->domain_data);
+	irqdomain = irq_domain_create_simple(dev_fwnode(dev->udev->dev.parent), 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);
Signature · 1 line
2.49.0
#32 lore raw

Re: [PATCH] net: Use dev_fwnode()

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 4 lines · On Wed, 11 Jun 2025 12:43:43 +0200 you wrote:

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().

Quoted 8 lines

So use the dev_fwnode() helper.

[...]

Here is the summary with links:
- net: Use dev_fwnode()

    https://git.kernel.org/netdev/net-next/c/6d4e01d29d87

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#33 lore raw

PATCH 1/1 pci/controller: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

---
 drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 5 ++---
 drivers/pci/controller/pcie-mediatek-gen3.c          | 3 +--
 2 files changed, 3 insertions(+), 5 deletions(-)
drivers/pci/controller/mobiveil/pcie-mobiveil-host.c +2 -3
index a600f46ee3c3..cd44ddb698ea 100644
@@ -464,9 +464,8 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie)
 	struct mobiveil_root_port *rp = &pcie->rp;
 
 	/* setup INTx */
-	rp->intx_domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node), PCI_NUM_INTX,
-						   &intx_domain_ops, pcie);
-
+	rp->intx_domain = irq_domain_create_linear(dev_fwnode(dev), PCI_NUM_INTX, &intx_domain_ops,
+						   pcie);
 	if (!rp->intx_domain) {
 		dev_err(dev, "Failed to get a INTx IRQ domain\n");
 		return -ENOMEM;
drivers/pci/controller/pcie-mediatek-gen3.c +1 -2
index b55f5973414c..5464b4ae5c20 100644
@@ -756,8 +756,7 @@ static int mtk_pcie_init_irq_domains(struct mtk_gen3_pcie *pcie)
 	/* Setup MSI */
 	mutex_init(&pcie->lock);
 
-	pcie->msi_bottom_domain = irq_domain_create_linear(of_fwnode_handle(node),
-							   PCIE_MSI_IRQS_NUM,
+	pcie->msi_bottom_domain = irq_domain_create_linear(dev_fwnode(dev), PCIE_MSI_IRQS_NUM,
 							   &mtk_msi_bottom_domain_ops, pcie);
 	if (!pcie->msi_bottom_domain) {
 		dev_err(dev, "failed to create MSI bottom domain\n");
Signature · 1 line
2.49.0
maintainer Applied
#34 lore raw

Re: (subset) [PATCH] pci/controller: Use dev_fwnode()

Quoted 8 lines · Jiri Slaby (SUSE)

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.

[...]

Applied, thanks!

[1/1] pci/controller: Use dev_fwnode()

      commit: 91afe85f4b282712231df9061a4528db51ce3c3b

Best regards,

Signature · 1 line
Manivannan Sadhasivam <[email protected]>
#35 lore raw

Re: [PATCH] pci/controller: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

[+cc Nam]

Quoted 4 lines · Jiri Slaby (SUSE)

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().

Quoted 8 lines

So use the dev_fwnode() helper.

---
 drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 5 ++---
 drivers/pci/controller/pcie-mediatek-gen3.c          | 3 +--

I think the pcie-mediatek-gen3.c part of this is no longer relevant after Nam's series [1]. This pcie-mediatek-gen3.c was the only thing on the pci/controller/mediatek-gen3 branch, so I'm going to drop that for now.

The pcie-mobiveil-host.c part is still queued on
pci/controller/mobiveil for v6.17.

[1] https://patch.msgid.link/bfbd2e375269071b69e1aa85e629ee4b7c99518f.1750858083.git.namcao@linutronix.de

Quoted 35 lines
 2 files changed, 3 insertions(+), 5 deletions(-)
drivers/pci/controller/mobiveil/pcie-mobiveil-host.c +2 -3
index a600f46ee3c3..cd44ddb698ea 100644
@@ -464,9 +464,8 @@ static int mobiveil_pcie_init_irq_domain(struct mobiveil_pcie *pcie)
 	struct mobiveil_root_port *rp = &pcie->rp;
 
 	/* setup INTx */
-	rp->intx_domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node), PCI_NUM_INTX,
-						   &intx_domain_ops, pcie);
-
+	rp->intx_domain = irq_domain_create_linear(dev_fwnode(dev), PCI_NUM_INTX, &intx_domain_ops,
+						   pcie);
 	if (!rp->intx_domain) {
 		dev_err(dev, "Failed to get a INTx IRQ domain\n");
 		return -ENOMEM;
drivers/pci/controller/pcie-mediatek-gen3.c +1 -2
index b55f5973414c..5464b4ae5c20 100644
@@ -756,8 +756,7 @@ static int mtk_pcie_init_irq_domains(struct mtk_gen3_pcie *pcie)
 	/* Setup MSI */
 	mutex_init(&pcie->lock);
 
-	pcie->msi_bottom_domain = irq_domain_create_linear(of_fwnode_handle(node),
-							   PCIE_MSI_IRQS_NUM,
+	pcie->msi_bottom_domain = irq_domain_create_linear(dev_fwnode(dev), PCIE_MSI_IRQS_NUM,
 							   &mtk_msi_bottom_domain_ops, pcie);
 	if (!pcie->msi_bottom_domain) {
 		dev_err(dev, "failed to create MSI bottom domain\n");
Signature · 1 line
2.49.0
#36 lore raw

Re: [PATCH] pci/controller: Use dev_fwnode()

Quoted 14 lines · Bjorn Helgaas
Quoted 4 lines · Jiri Slaby (SUSE)

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().

Quoted 8 lines

So use the dev_fwnode() helper.

---
 drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 5 ++---
 drivers/pci/controller/pcie-mediatek-gen3.c          | 3 +--
Quoted 2 lines

I think the pcie-mediatek-gen3.c part of this is no longer relevant after Nam's series [1].

fwnode is still needed after my patch. As part of
struct irq_domain_info info = { ... }

You could squash this one into my patch. I personally would leave it be. But fine to me either way.

Quoted 7 lines

This pcie-mediatek-gen3.c was the only thing on the pci/controller/mediatek-gen3 branch, so I'm going to drop that for now.

The pcie-mobiveil-host.c part is still queued on
pci/controller/mobiveil for v6.17.

[1] https://patch.msgid.link/bfbd2e375269071b69e1aa85e629ee4b7c99518f.1750858083.git.namcao@linutronix.de

Best regards,
Nam

#37 lore raw

Re: [PATCH] pci/controller: Use dev_fwnode()

[+cc Arnd]

Quoted 15 lines · Nam Cao
Quoted 14 lines · Bjorn Helgaas
Quoted 12 lines · Jiri Slaby (SUSE)

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.

---
 drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 5 ++---
 drivers/pci/controller/pcie-mediatek-gen3.c          | 3 +--
Quoted 8 lines
Quoted 2 lines

I think the pcie-mediatek-gen3.c part of this is no longer relevant after Nam's series [1].

fwnode is still needed after my patch. As part of
struct irq_domain_info info = { ... }

You could squash this one into my patch. I personally would leave it be. But fine to me either way.

Oh, I think I see what happened:

- Jiri replaced of_fwnode_handle() with dev_fwnode() in the irq_domain_create_linear() call [1]

- On top of that, Nam replaced irq_domain_create_linear() with msi_create_parent_irq_domain(), and moved the dev_fwnode() to the struct irq_domain_info [2]

- I rebuilt pci/next with Nam's series merged *before* Jiri's, resulting in a conflict (of_fwnode_handle() was still used in the irq_domain_create_linear() call) which I resolved by using dev_fwnode() when building struct irq_domain_info [3]

I think the result [4] is OK, but it's not ideal because a dev_fwnode() conversion got inserted into Nam's patch without explanation.

So I think I'll put Jiri's patches (along with Arnd's similar altera patch [5]) on a branch and merge them before Nam's.

Jiri, question for you: even after all this, there are still several uses in drivers/pci/ of of_fwnode_handle() to extract the fwnode_handle for a struct device * [6,7,8,9,10,11,12].

Should these also be changed?

Bjorn

[1] https://lore.kernel.org/r/[email protected]
[2] https://patch.msgid.link/bfbd2e375269071b69e1aa85e629ee4b7c99518f.1750858083.git.namcao@linutronix.de
[3] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/commit/?id=dd6fad415071
[4] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/pcie-mediatek-gen3.c?id=beedc9eb3114#n750
[5] https://lore.kernel.org/r/[email protected]

[6] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/dwc/pcie-designware-host.c?id=beedc9eb3114#n217
[7] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c?id=beedc9eb3114#n442
[8] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/pcie-altera-msi.c?id=beedc9eb3114#n169
[9] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/pcie-mediatek.c?id=beedc9eb3114#n490
[10] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/pcie-xilinx-dma-pl.c?id=beedc9eb3114#n468
[11] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/pcie-xilinx-nwl.c?id=beedc9eb3114#n501
[12] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/plda/pcie-plda-host.c?id=beedc9eb3114#n156

#38 lore raw

Re: [PATCH] pci/controller: Use dev_fwnode()

Jiri, question for you below about more possible drivers/pci/ conversions to use dev_fwnode() for struct device * cases.

Would like to get this in for v6.17 if these should be changed.

Bjorn

Quoted 67 lines · Bjorn Helgaas
Quoted 15 lines · Nam Cao
Quoted 14 lines · Bjorn Helgaas
Quoted 12 lines · Jiri Slaby (SUSE)

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.

---
 drivers/pci/controller/mobiveil/pcie-mobiveil-host.c | 5 ++---
 drivers/pci/controller/pcie-mediatek-gen3.c          | 3 +--
Quoted 8 lines
Quoted 2 lines

I think the pcie-mediatek-gen3.c part of this is no longer relevant after Nam's series [1].

fwnode is still needed after my patch. As part of
struct irq_domain_info info = { ... }

You could squash this one into my patch. I personally would leave it be. But fine to me either way.

Oh, I think I see what happened:

- Jiri replaced of_fwnode_handle() with dev_fwnode() in the irq_domain_create_linear() call [1]

- On top of that, Nam replaced irq_domain_create_linear() with msi_create_parent_irq_domain(), and moved the dev_fwnode() to the struct irq_domain_info [2]

- I rebuilt pci/next with Nam's series merged *before* Jiri's, resulting in a conflict (of_fwnode_handle() was still used in the irq_domain_create_linear() call) which I resolved by using dev_fwnode() when building struct irq_domain_info [3]

I think the result [4] is OK, but it's not ideal because a dev_fwnode() conversion got inserted into Nam's patch without explanation.

So I think I'll put Jiri's patches (along with Arnd's similar altera patch [5]) on a branch and merge them before Nam's.

Jiri, question for you: even after all this, there are still several uses in drivers/pci/ of of_fwnode_handle() to extract the fwnode_handle for a struct device * [6,7,8,9,10,11,12].

Should these also be changed?

Bjorn

[1] https://lore.kernel.org/r/[email protected]
[2] https://patch.msgid.link/bfbd2e375269071b69e1aa85e629ee4b7c99518f.1750858083.git.namcao@linutronix.de
[3] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/commit/?id=dd6fad415071
[4] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/pcie-mediatek-gen3.c?id=beedc9eb3114#n750
[5] https://lore.kernel.org/r/[email protected]

[6] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/dwc/pcie-designware-host.c?id=beedc9eb3114#n217
[7] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/mobiveil/pcie-mobiveil-host.c?id=beedc9eb3114#n442
[8] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/pcie-altera-msi.c?id=beedc9eb3114#n169
[9] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/pcie-mediatek.c?id=beedc9eb3114#n490
[10] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/pcie-xilinx-dma-pl.c?id=beedc9eb3114#n468
[11] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/pcie-xilinx-nwl.c?id=beedc9eb3114#n501
[12] https://git.kernel.org/cgit/linux/kernel/git/pci/pci.git/tree/drivers/pci/controller/plda/pcie-plda-host.c?id=beedc9eb3114#n156

author
#39 lore raw

Re: [PATCH] pci/controller: Use dev_fwnode()

Quoted 2 lines · Bjorn Helgaas

Jiri, question for you below about more possible drivers/pci/ conversions to use dev_fwnode() for struct device * cases.

Sorry, I am a way too occupied :/.

Quoted 1 line

Would like to get this in for v6.17 if these should be changed.

It's not necessary, but a good to have cleanup (opposed to the posted fixes, which were required). I will switch those eventually, but I don't promise 6.17. (If someone does not beat me to it.)

thanks,

Signature · 2 lines
js
suse labs
#40 lore raw

Re: [PATCH] pci/controller: Use dev_fwnode()

Quoted 11 lines · Jiri Slaby
Quoted 2 lines · Bjorn Helgaas

Jiri, question for you below about more possible drivers/pci/ conversions to use dev_fwnode() for struct device * cases.

Sorry, I am a way too occupied :/.

Quoted 1 line

Would like to get this in for v6.17 if these should be changed.

It's not necessary, but a good to have cleanup (opposed to the posted fixes, which were required). I will switch those eventually, but I don't promise 6.17. (If someone does not beat me to it.)

It's not clear from the commit log:

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.

why the posted fixes are required (other than Arnd's change to altera_pcie_init_irq_domain(), which fixes an unused variable warning when CONFIG_OF is not enabled).

Since it sounds like no changes are required for the other ones I mentioned, I'm going to leave them alone for now:

dw_pcie_allocate_domains()
mobiveil_allocate_msi_domains()
altera_allocate_domains()
mtk_pcie_allocate_msi_domains()
xilinx_pl_dma_pcie_init_msi_irq_domain()
nwl_pcie_init_msi_irq_domain()
plda_allocate_msi_domains()

Bjorn

author
#41 lore raw

Re: [PATCH] pci/controller: Use dev_fwnode()

Quoted 19 lines · Bjorn Helgaas
Quoted 11 lines · Jiri Slaby
Quoted 2 lines · Bjorn Helgaas

Jiri, question for you below about more possible drivers/pci/ conversions to use dev_fwnode() for struct device * cases.

Sorry, I am a way too occupied :/.

Quoted 1 line

Would like to get this in for v6.17 if these should be changed.

It's not necessary, but a good to have cleanup (opposed to the posted fixes, which were required). I will switch those eventually, but I don't promise 6.17. (If someone does not beat me to it.)

It's not clear from the commit log:

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().

Quoted 5 lines

So use the dev_fwnode() helper.

why the posted fixes are required (other than Arnd's change to altera_pcie_init_irq_domain(), which fixes an unused variable warning when CONFIG_OF is not enabled).

Sorry, my bad. These are a cleanup suggested in this series:
https://lore.kernel.org/all/[email protected]/

I.e. series switching from irq_domain_add_*() (take of_node) to irq_domain_create_*() (take fwnode).

These days, fwnode is preferred and if there were no more users of of_node in changed functions, the series above even produced warnings (Arnd's and others' fixes).

Quoted 10 lines

Since it sounds like no changes are required for the other ones I mentioned, I'm going to leave them alone for now:

dw_pcie_allocate_domains()
mobiveil_allocate_msi_domains()
altera_allocate_domains()
mtk_pcie_allocate_msi_domains()
xilinx_pl_dma_pcie_init_msi_irq_domain()
nwl_pcie_init_msi_irq_domain()
plda_allocate_msi_domains()

Given fwnode is always used them, it's not necessary to use dev_fwnode(). But it'd be a nice cleanup. Provided the list, I started the cleanup now :).

thanks,

Signature · 2 lines
js
suse labs
#42 lore raw

PATCH 1/1 pinctrl: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

--

Cc Matthias Brugger <[email protected]>
Cc AngeloGioacchino Del Regno <[email protected]>
Cc Ludovic Desroches <[email protected]>
Cc Nicolas Ferre <[email protected]>
Cc Alexandre Belloni <[email protected]>
Cc Claudiu Beznea <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc Jernej Skrabec <[email protected]>
Cc Samuel Holland <[email protected]>
---
 drivers/pinctrl/mediatek/mtk-eint.c   | 4 ++--
 drivers/pinctrl/pinctrl-at91-pio4.c   | 6 +++---
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/pinctrl/mediatek/mtk-eint.c +2 -2
index d906a5e4101f..9f175c73613f 100644
@@ -561,8 +561,8 @@ int mtk_eint_do_init(struct mtk_eint *eint, struct mtk_eint_pin *eint_pin)
 			goto err_eint;
 	}
 
-	eint->domain = irq_domain_create_linear(of_fwnode_handle(eint->dev->of_node),
-						eint->hw->ap_num, &irq_domain_simple_ops, NULL);
+	eint->domain = irq_domain_create_linear(dev_fwnode(eint->dev), eint->hw->ap_num,
+						&irq_domain_simple_ops, NULL);
 	if (!eint->domain)
 		goto err_eint;
 
drivers/pinctrl/pinctrl-at91-pio4.c +3 -3
index ca8a54a43ff5..57f105ac962d 100644
@@ -1212,9 +1212,9 @@ static int atmel_pinctrl_probe(struct platform_device *pdev)
 		dev_dbg(dev, "bank %i: irq=%d\n", i, ret);
 	}
 
-	atmel_pioctrl->irq_domain = irq_domain_create_linear(of_fwnode_handle(dev->of_node),
-			atmel_pioctrl->gpio_chip->ngpio,
-			&irq_domain_simple_ops, NULL);
+	atmel_pioctrl->irq_domain = irq_domain_create_linear(dev_fwnode(dev),
+							     atmel_pioctrl->gpio_chip->ngpio,
+							     &irq_domain_simple_ops, NULL);
 	if (!atmel_pioctrl->irq_domain)
 		return dev_err_probe(dev, -ENODEV, "can't add the irq domain\n");
 
drivers/pinctrl/sunxi/pinctrl-sunxi.c +1 -1
index bf8612d72daa..a090d78a3413 100644
@@ -1646,7 +1646,7 @@ int sunxi_pinctrl_init_with_flags(struct platform_device *pdev,
 		}
 	}
 
-	pctl->domain = irq_domain_create_linear(of_fwnode_handle(node),
+	pctl->domain = irq_domain_create_linear(dev_fwnode(&pdev->dev),
 						pctl->desc->irq_banks * IRQ_PER_BANK,
 						&sunxi_pinctrl_irq_domain_ops, pctl);
 	if (!pctl->domain) {
Signature · 1 line
2.49.0
Acked-by on v1 1/1
#43 lore raw

Re: [PATCH] pinctrl: Use dev_fwnode()

Quoted 26 lines · Jiri Slaby (SUSE)

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.

--

Cc Matthias Brugger <[email protected]>
Cc AngeloGioacchino Del Regno <[email protected]>
Cc Ludovic Desroches <[email protected]>
Cc Nicolas Ferre <[email protected]>
Cc Alexandre Belloni <[email protected]>
Cc Claudiu Beznea <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc Jernej Skrabec <[email protected]>
Cc Samuel Holland <[email protected]>
Quoted 4 lines
---
 drivers/pinctrl/mediatek/mtk-eint.c   | 4 ++--
 drivers/pinctrl/pinctrl-at91-pio4.c   | 6 +++---
 drivers/pinctrl/sunxi/pinctrl-sunxi.c | 2 +-
#44 lore raw

Re: [PATCH] pinctrl: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)
Quoted 10 lines · Jiri Slaby (SUSE)

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.

Patch applied!

Yours,
Linus Walleij

#45 lore raw

PATCH 1/1 powerpc: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

Cc Christophe Leroy <[email protected]>
Cc Madhavan Srinivasan <[email protected]>
Cc Michael Ellerman <[email protected]>
Cc Nicholas Piggin <[email protected]>
Cc Naveen N Rao <[email protected]>
---
 arch/powerpc/platforms/8xx/cpm1-ic.c | 3 +--
 arch/powerpc/sysdev/fsl_msi.c        | 5 ++---
 2 files changed, 3 insertions(+), 5 deletions(-)
arch/powerpc/platforms/8xx/cpm1-ic.c +1 -2
index a49d4a9ab3bc..3292071e4da3 100644
@@ -110,8 +110,7 @@ static int cpm_pic_probe(struct platform_device *pdev)
 
 	out_be32(&data->reg->cpic_cimr, 0);
 
-	data->host = irq_domain_create_linear(of_fwnode_handle(dev->of_node),
-					      64, &cpm_pic_host_ops, data);
+	data->host = irq_domain_create_linear(dev_fwnode(dev), 64, &cpm_pic_host_ops, data);
 	if (!data->host)
 		return -ENODEV;
 
arch/powerpc/sysdev/fsl_msi.c +2 -3
index 4fe8a7b1b288..2a007bfb038d 100644
@@ -412,9 +412,8 @@ static int fsl_of_msi_probe(struct platform_device *dev)
 	}
 	platform_set_drvdata(dev, msi);
 
-	msi->irqhost = irq_domain_create_linear(of_fwnode_handle(dev->dev.of_node),
-				      NR_MSI_IRQS_MAX, &fsl_msi_host_ops, msi);
-
+	msi->irqhost = irq_domain_create_linear(dev_fwnode(&dev->dev), NR_MSI_IRQS_MAX,
+						&fsl_msi_host_ops, msi);
 	if (msi->irqhost == NULL) {
 		dev_err(&dev->dev, "No memory for MSI irqhost\n");
 		err = -ENOMEM;
Signature · 1 line
2.49.0
#46 lore raw

PATCH 1/1 soc: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

Cc Qiang Zhao <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>

---
Cc: [email protected]

---
 drivers/soc/fsl/qe/qe_ic.c | 3 +--
 drivers/soc/tegra/pmc.c    | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)
drivers/soc/fsl/qe/qe_ic.c +1 -2
index 4068b501a3a3..943911053af6 100644
@@ -407,7 +407,6 @@ static int qe_ic_init(struct platform_device *pdev)
 	void (*high_handler)(struct irq_desc *desc);
 	struct qe_ic *qe_ic;
 	struct resource *res;
-	struct device_node *node = pdev->dev.of_node;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (res == NULL) {
@@ -441,7 +440,7 @@ static int qe_ic_init(struct platform_device *pdev)
 		high_handler = NULL;
 	}
 
-	qe_ic->irqhost = irq_domain_create_linear(of_fwnode_handle(node), NR_QE_IC_INTS,
+	qe_ic->irqhost = irq_domain_create_linear(dev_fwnode(&pdev->dev), NR_QE_IC_INTS,
 						  &qe_ic_host_ops, qe_ic);
 	if (qe_ic->irqhost == NULL) {
 		dev_err(dev, "failed to add irq domain\n");
drivers/soc/tegra/pmc.c +1 -2
index e0d67bfe955c..9543bee0c321 100644
@@ -2500,8 +2500,7 @@ static int tegra_pmc_irq_init(struct tegra_pmc *pmc)
 	pmc->irq.irq_set_type = pmc->soc->irq_set_type;
 	pmc->irq.irq_set_wake = pmc->soc->irq_set_wake;
 
-	pmc->domain = irq_domain_create_hierarchy(parent, 0, 96,
-						  of_fwnode_handle(pmc->dev->of_node),
+	pmc->domain = irq_domain_create_hierarchy(parent, 0, 96, dev_fwnode(pmc->dev),
 						  &tegra_pmc_irq_domain_ops, pmc);
 	if (!pmc->domain) {
 		dev_err(pmc->dev, "failed to allocate domain\n");
Signature · 1 line
2.49.0
Acked-by on v1 1/1
#47 lore raw

Re: [PATCH] soc: Use dev_fwnode()

Quoted 14 lines · Jiri Slaby (SUSE)

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.

Cc Qiang Zhao <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>
Quoted 6 lines

---
Cc: [email protected]

---
 drivers/soc/fsl/qe/qe_ic.c | 3 +--
 drivers/soc/tegra/pmc.c    | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

Nice.

#48 lore raw

Re: [PATCH] soc: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)
Quoted 14 lines · Jiri Slaby (SUSE)

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.

Cc Qiang Zhao <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>
Quoted 5 lines

---
Cc: [email protected]

---
 drivers/soc/fsl/qe/qe_ic.c | 3 +--
 drivers/soc/tegra/pmc.c    | 3 +--

These are separate subsystems. You need to split the patch per each actual SoC vendor.

Best regards,
Krzysztof

#49 lore raw

Re: [PATCH] soc: Use dev_fwnode()

Le 12/06/2025 à 13:31, Krzysztof Kozlowski a écrit :

Quoted 15 lines · Jiri Slaby (SUSE)
Quoted 14 lines

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.

Cc Qiang Zhao <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>
Quoted 8 lines
Quoted 5 lines

---
Cc: [email protected]

---
  drivers/soc/fsl/qe/qe_ic.c | 3 +--
  drivers/soc/tegra/pmc.c    | 3 +--

These are separate subsystems. You need to split the patch per each actual SoC vendor.

It has already been Acked by Thierry Reding who maintains tegra so I can take this patch as is via soc/fsl tree.

Christophe

#50 lore raw

Re: [PATCH] soc: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

Hi,

Le 11/06/2025 à 12:43, Jiri Slaby (SUSE) a écrit :

Quoted 6 lines

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.

Quoted 7 lines
Cc Qiang Zhao <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>

There must be something wrong with this patch. b4 shazam applies a different patch.

$ b4 shazam -l -s --single-message --no-parent [email protected]
Single-message mode, ignoring any follow-ups
Grabbing thread from lore.kernel.org/all/[email protected]/t.mbox.gz
Breaking thread to remove parents of [email protected]
Checking for newer revisions
Grabbing search results from lore.kernel.org
  Added from v2: 1 patches
Analyzing 25 messages in the thread
Looking for additional code-review trailers on lore.kernel.org
Analyzing 22 code-review messages
Will use the latest revision: v2
You can pick other revisions using the -vN flag
Checking attestation on all messages, may take a moment...
---
  ✓ [PATCH v2] iio: adc: stm32-adc: Use dev_fwnode()
    + Reviewed-by: David Lechner <[email protected]> (✗ 
DKIM/baylibre-com.20230601.gappssmtp.com)
    + Link: 
https://lore.kernel.org/r/[email protected]
    + Signed-off-by: Christophe Leroy <[email protected]>
  ---
  ✓ Signed: DKIM/kernel.org
---
Total patches: 1
---
Application de  iio: adc: stm32-adc: Use dev_fwnode()

You must have posted another patch with the same message ID. I had to apply it manually.

Christophe

Quoted 43 lines

---
Cc: [email protected]

---
  drivers/soc/fsl/qe/qe_ic.c | 3 +--
  drivers/soc/tegra/pmc.c    | 3 +--
  2 files changed, 2 insertions(+), 4 deletions(-)
drivers/soc/fsl/qe/qe_ic.c +1 -2
index 4068b501a3a3..943911053af6 100644
@@ -407,7 +407,6 @@ static int qe_ic_init(struct platform_device *pdev)
  	void (*high_handler)(struct irq_desc *desc);
  	struct qe_ic *qe_ic;
  	struct resource *res;
-	struct device_node *node = pdev->dev.of_node;
 
  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
  	if (res == NULL) {
@@ -441,7 +440,7 @@ static int qe_ic_init(struct platform_device *pdev)
  		high_handler = NULL;
  	}
 
-	qe_ic->irqhost = irq_domain_create_linear(of_fwnode_handle(node), NR_QE_IC_INTS,
+	qe_ic->irqhost = irq_domain_create_linear(dev_fwnode(&pdev->dev), NR_QE_IC_INTS,
  						  &qe_ic_host_ops, qe_ic);
  	if (qe_ic->irqhost == NULL) {
  		dev_err(dev, "failed to add irq domain\n");
drivers/soc/tegra/pmc.c +1 -2
index e0d67bfe955c..9543bee0c321 100644
@@ -2500,8 +2500,7 @@ static int tegra_pmc_irq_init(struct tegra_pmc *pmc)
  	pmc->irq.irq_set_type = pmc->soc->irq_set_type;
  	pmc->irq.irq_set_wake = pmc->soc->irq_set_wake;
 
-	pmc->domain = irq_domain_create_hierarchy(parent, 0, 96,
-						  of_fwnode_handle(pmc->dev->of_node),
+	pmc->domain = irq_domain_create_hierarchy(parent, 0, 96, dev_fwnode(pmc->dev),
  						  &tegra_pmc_irq_domain_ops, pmc);
  	if (!pmc->domain) {
  		dev_err(pmc->dev, "failed to allocate domain\n");
#51 lore raw

Re: [PATCH] soc: Use dev_fwnode()

Le 08/07/2025 à 10:33, Christophe Leroy a écrit :

Quoted 46 lines

Hi,

Le 11/06/2025 à 12:43, Jiri Slaby (SUSE) a écrit :

Quoted 6 lines

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.

Quoted 7 lines
Cc Qiang Zhao <[email protected]>
Cc Christophe Leroy <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>

There must be something wrong with this patch. b4 shazam applies a different patch.

$ b4 shazam -l -s --single-message --no-parent 20250611104348.192092-19- [email protected]
Single-message mode, ignoring any follow-ups
Grabbing thread from lore.kernel.org/all/20250611104348.192092-19- [email protected]/t.mbox.gz
Breaking thread to remove parents of 20250611104348.192092-19- [email protected]
Checking for newer revisions
Grabbing search results from lore.kernel.org
   Added from v2: 1 patches
Analyzing 25 messages in the thread
Looking for additional code-review trailers on lore.kernel.org
Analyzing 22 code-review messages
Will use the latest revision: v2
You can pick other revisions using the -vN flag
Checking attestation on all messages, may take a moment...
---
   ✓ [PATCH v2] iio: adc: stm32-adc: Use dev_fwnode()
     + Reviewed-by: David Lechner <[email protected]> (✗ DKIM/ 
baylibre-com.20230601.gappssmtp.com)
     + Link: https://lore.kernel.org/r/20250612084627.217341-1- 
[email protected]
     + Signed-off-by: Christophe Leroy <[email protected]>
   ---
   ✓ Signed: DKIM/kernel.org
---
Total patches: 1
---
Application de  iio: adc: stm32-adc: Use dev_fwnode()
Quoted 2 lines

You must have posted another patch with the same message ID. I had to apply it manually.

Applied (Manually), thanks!

#52 lore raw

PATCH 1/1 thermal: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)

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.

Cc Amit Kucheria <[email protected]>
Cc Thara Gopinath <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Daniel Lezcano <[email protected]>
Cc Zhang Rui <[email protected]>
Cc Lukasz Luba <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>

---
Cc: [email protected]

---
 drivers/thermal/qcom/lmh.c       |  3 +--
 drivers/thermal/tegra/soctherm.c | 13 +++++--------
 2 files changed, 6 insertions(+), 10 deletions(-)
drivers/thermal/qcom/lmh.c +1 -2
index 991d1573983d..75eaa9a68ab8 100644
@@ -209,8 +209,7 @@ static int lmh_probe(struct platform_device *pdev)
 	}
 
 	lmh_data->irq = platform_get_irq(pdev, 0);
-	lmh_data->domain = irq_domain_create_linear(of_fwnode_handle(np), 1, &lmh_irq_ops,
-						    lmh_data);
+	lmh_data->domain = irq_domain_create_linear(dev_fwnode(dev), 1, &lmh_irq_ops, lmh_data);
 	if (!lmh_data->domain) {
 		dev_err(dev, "Error adding irq_domain\n");
 		return -EINVAL;
drivers/thermal/tegra/soctherm.c +5 -8
index 926f1052e6de..53a5c649f4b1 100644
@@ -1206,7 +1206,7 @@ static const struct irq_domain_ops soctherm_oc_domain_ops = {
 /**
  * soctherm_oc_int_init() - Initial enabling of the over
  * current interrupts
- * @np:	The devicetree node for soctherm
+ * @fwnode:	The devicetree node for soctherm
  * @num_irqs:	The number of new interrupt requests
  *
  * Sets the over current interrupt request chip data
@@ -1215,7 +1215,7 @@ static const struct irq_domain_ops soctherm_oc_domain_ops = {
  * -ENOMEM (out of memory), or irq_base if the function failed to
  * allocate the irqs
  */
-static int soctherm_oc_int_init(struct device_node *np, int num_irqs)
+static int soctherm_oc_int_init(struct fwnode_handle *fwnode, int num_irqs)
 {
 	if (!num_irqs) {
 		pr_info("%s(): OC interrupts are not enabled\n", __func__);
@@ -1234,10 +1234,8 @@ static int soctherm_oc_int_init(struct device_node *np, int num_irqs)
 	soc_irq_cdata.irq_chip.irq_set_type = soctherm_oc_irq_set_type;
 	soc_irq_cdata.irq_chip.irq_set_wake = NULL;
 
-	soc_irq_cdata.domain = irq_domain_create_linear(of_fwnode_handle(np), num_irqs,
-						     &soctherm_oc_domain_ops,
-						     &soc_irq_cdata);
-
+	soc_irq_cdata.domain = irq_domain_create_linear(fwnode, num_irqs, &soctherm_oc_domain_ops,
+							&soc_irq_cdata);
 	if (!soc_irq_cdata.domain) {
 		pr_err("%s: Failed to create IRQ domain\n", __func__);
 		return -ENOMEM;
@@ -1968,10 +1966,9 @@ static void tegra_soctherm_throttle(struct device *dev)
 static int soctherm_interrupts_init(struct platform_device *pdev,
 				    struct tegra_soctherm *tegra)
 {
-	struct device_node *np = pdev->dev.of_node;
 	int ret;
 
-	ret = soctherm_oc_int_init(np, TEGRA_SOC_OC_IRQ_MAX);
+	ret = soctherm_oc_int_init(dev_fwnode(&pdev->dev), TEGRA_SOC_OC_IRQ_MAX);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "soctherm_oc_int_init failed\n");
 		return ret;
Signature · 1 line
2.49.0
Acked-by on v1 1/1
#53 lore raw

Re: [PATCH] thermal: Use dev_fwnode()

Quoted 17 lines · Jiri Slaby (SUSE)

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.

Cc Amit Kucheria <[email protected]>
Cc Thara Gopinath <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Daniel Lezcano <[email protected]>
Cc Zhang Rui <[email protected]>
Cc Lukasz Luba <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>
Quoted 6 lines

---
Cc: [email protected]

---
 drivers/thermal/qcom/lmh.c       |  3 +--
 drivers/thermal/tegra/soctherm.c | 13 +++++--------
 2 files changed, 6 insertions(+), 10 deletions(-)
#54 lore raw

Re: [PATCH] thermal: Use dev_fwnode()

In reply to Jiri Slaby (SUSE)
Quoted 17 lines · Jiri Slaby (SUSE)

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.

Cc Amit Kucheria <[email protected]>
Cc Thara Gopinath <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Cc Daniel Lezcano <[email protected]>
Cc Zhang Rui <[email protected]>
Cc Lukasz Luba <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>
Quoted 3 lines

---
Cc: [email protected]
---

Applied, thanks

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog