Linux driver-core infrastructure
 help / color / mirror / Atom feed
* [PATCH 0/8] driver core: prefer platform_device_set_fwnode()
@ 2026-07-20  9:24 Bartosz Golaszewski
  2026-07-20  9:24 ` [PATCH 1/8] powerpc/powermac: use platform_device_set_fwnode() Bartosz Golaszewski
                   ` (7 more replies)
  0 siblings, 8 replies; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-20  9:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla
  Cc: brgl, driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu,
	netdev, linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm,
	linux-sound, Bartosz Golaszewski

With the final platform device and software node rework changes having
been queued in the driver core tree, Danilo pointed out that
platform_device_set_fwnode() is no longer used and should be removed. I
argued that instead we should prefer it over the OF-specific
platform_device_set_of_node().

This series converts drivers using platform_device_set_of_node() to
platform_device_set_fwnode() and does not intend any functional change
as the semantics of:

  platform_device_set_of_node(pdev, np);

should be equal to those of:

  platform_device_set_fwnode(pdev, of_fwnode_handle(np));

The prerequisite changes are currently in the driver core tree so this
entire series should follow them as well with Acks from maintainers. If
it doesn't make v7.3 for some reason, then I will resend these next
cycle separately targetting individual trees.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
Bartosz Golaszewski (8):
      powerpc/powermac: use platform_device_set_fwnode()
      i2c: pxa-pci: use platform_device_set_fwnode()
      iommu/fsl: use platform_device_set_fwnode()
      net: bcmgenet: use platform_device_set_fwnode()
      pmdomain: imx: use platform_device_set_fwnode()
      mfd: tps6586: use platform_device_set_fwnode()
      net: mv643xx: use platform_device_set_fwnode()
      slimbus: qcom-ngd-ctrl: use platform_device_set_fwnode()

 arch/powerpc/platforms/powermac/low_i2c.c    | 2 +-
 drivers/i2c/busses/i2c-pxa-pci.c             | 2 +-
 drivers/iommu/fsl_pamu.c                     | 2 +-
 drivers/mfd/tps6586x.c                       | 2 +-
 drivers/net/ethernet/broadcom/genet/bcmmii.c | 3 ++-
 drivers/net/ethernet/marvell/mv643xx_eth.c   | 2 +-
 drivers/pmdomain/imx/gpc.c                   | 2 +-
 drivers/slimbus/qcom-ngd-ctrl.c              | 2 +-
 8 files changed, 9 insertions(+), 8 deletions(-)
---
base-commit: 27edebd505791748a77703e311d76f0f55a8d7ec
change-id: 20260720-pdev-set-fwnode-instead-of-of-node-e83ece371509

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 21+ messages in thread

* [PATCH 1/8] powerpc/powermac: use platform_device_set_fwnode()
  2026-07-20  9:24 [PATCH 0/8] driver core: prefer platform_device_set_fwnode() Bartosz Golaszewski
@ 2026-07-20  9:24 ` Bartosz Golaszewski
  2026-07-20  9:24 ` [PATCH 2/8] i2c: pxa-pci: " Bartosz Golaszewski
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-20  9:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla
  Cc: brgl, driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu,
	netdev, linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm,
	linux-sound, Bartosz Golaszewski

Prefer the higher-level platform_device_set_fwnode() over the
OF-specific platform_device_set_of_node() for dynamically allocated
platform devices.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 arch/powerpc/platforms/powermac/low_i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
index a175a32a222bab4cc7400f6ab6071f5630db2cb8..eda35534cfd72e828616f27b5f8319189d68285e 100644
--- a/arch/powerpc/platforms/powermac/low_i2c.c
+++ b/arch/powerpc/platforms/powermac/low_i2c.c
@@ -1471,7 +1471,7 @@ static int __init pmac_i2c_create_platform_devices(void)
 		if (bus->platform_dev == NULL)
 			return -ENOMEM;
 		bus->platform_dev->dev.platform_data = bus;
-		platform_device_set_of_node(bus->platform_dev, bus->busnode);
+		platform_device_set_fwnode(bus->platform_dev, of_fwnode_handle(bus->busnode));
 		platform_device_add(bus->platform_dev);
 	}
 

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 2/8] i2c: pxa-pci: use platform_device_set_fwnode()
  2026-07-20  9:24 [PATCH 0/8] driver core: prefer platform_device_set_fwnode() Bartosz Golaszewski
  2026-07-20  9:24 ` [PATCH 1/8] powerpc/powermac: use platform_device_set_fwnode() Bartosz Golaszewski
@ 2026-07-20  9:24 ` Bartosz Golaszewski
  2026-07-20  9:41   ` Wolfram Sang
  2026-07-20  9:24 ` [PATCH 3/8] iommu/fsl: " Bartosz Golaszewski
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-20  9:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla
  Cc: brgl, driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu,
	netdev, linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm,
	linux-sound, Bartosz Golaszewski

Prefer the higher-level platform_device_set_fwnode() over the
OF-specific platform_device_set_of_node() for dynamically allocated
platform devices.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/i2c/busses/i2c-pxa-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c
index 92a0647f08c69f841ca99caca757c1728b3f6fce..58532cf9f06d43a0f2173b962eb498c9e4bb81d0 100644
--- a/drivers/i2c/busses/i2c-pxa-pci.c
+++ b/drivers/i2c/busses/i2c-pxa-pci.c
@@ -77,7 +77,7 @@ static struct platform_device *add_i2c_device(struct pci_dev *dev, int bar)
 	}
 	pdev->dev.parent = &dev->dev;
 
-	platform_device_set_of_node(pdev, child);
+	platform_device_set_fwnode(pdev, of_fwnode_handle(child));
 
 	ret = platform_device_add_resources(pdev, res, ARRAY_SIZE(res));
 	if (ret)

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 3/8] iommu/fsl: use platform_device_set_fwnode()
  2026-07-20  9:24 [PATCH 0/8] driver core: prefer platform_device_set_fwnode() Bartosz Golaszewski
  2026-07-20  9:24 ` [PATCH 1/8] powerpc/powermac: use platform_device_set_fwnode() Bartosz Golaszewski
  2026-07-20  9:24 ` [PATCH 2/8] i2c: pxa-pci: " Bartosz Golaszewski
@ 2026-07-20  9:24 ` Bartosz Golaszewski
  2026-07-20 12:58   ` Robin Murphy
  2026-07-20 14:34   ` Frank Li
  2026-07-20  9:24 ` [PATCH 4/8] net: bcmgenet: " Bartosz Golaszewski
                   ` (4 subsequent siblings)
  7 siblings, 2 replies; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-20  9:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla
  Cc: brgl, driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu,
	netdev, linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm,
	linux-sound, Bartosz Golaszewski

Prefer the higher-level platform_device_set_fwnode() over the
OF-specific platform_device_set_of_node() for dynamically allocated
platform devices.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/iommu/fsl_pamu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
index c83bbc3faad56d6ee1c89b0a7f74028af02c81e9..268a1f752fbceab4fd24013aeea5df1b6982fbb1 100644
--- a/drivers/iommu/fsl_pamu.c
+++ b/drivers/iommu/fsl_pamu.c
@@ -975,7 +975,7 @@ static __init int fsl_pamu_init(void)
 		goto error_device_alloc;
 	}
 
-	platform_device_set_of_node(pdev, np);
+	platform_device_set_fwnode(pdev, of_fwnode_handle(np));
 
 	ret = pamu_domain_init();
 	if (ret)

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 4/8] net: bcmgenet: use platform_device_set_fwnode()
  2026-07-20  9:24 [PATCH 0/8] driver core: prefer platform_device_set_fwnode() Bartosz Golaszewski
                   ` (2 preceding siblings ...)
  2026-07-20  9:24 ` [PATCH 3/8] iommu/fsl: " Bartosz Golaszewski
@ 2026-07-20  9:24 ` Bartosz Golaszewski
  2026-07-20 14:38   ` Andrew Lunn
  2026-07-20  9:24 ` [PATCH 5/8] pmdomain: imx: " Bartosz Golaszewski
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-20  9:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla
  Cc: brgl, driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu,
	netdev, linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm,
	linux-sound, Bartosz Golaszewski

Prefer the higher-level platform_device_set_fwnode() over the
OF-specific platform_device_set_of_node() for dynamically allocated
platform devices.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/net/ethernet/broadcom/genet/bcmmii.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/broadcom/genet/bcmmii.c b/drivers/net/ethernet/broadcom/genet/bcmmii.c
index 0f0dbabfaabbce3469de79af91d7731b8476709f..6f471723bd53f454e4b0de1716977b4382013429 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmmii.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmmii.c
@@ -492,7 +492,8 @@ static int bcmgenet_mii_register(struct bcmgenet_priv *priv)
 	ppdev->dev.parent = &pdev->dev;
 
 	if (dn)
-		platform_device_set_of_node(ppdev, bcmgenet_mii_of_find_mdio(priv));
+		platform_device_set_fwnode(ppdev,
+					   of_fwnode_handle(bcmgenet_mii_of_find_mdio(priv)));
 	else
 		ppd.phy_mask = ~0;
 

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 5/8] pmdomain: imx: use platform_device_set_fwnode()
  2026-07-20  9:24 [PATCH 0/8] driver core: prefer platform_device_set_fwnode() Bartosz Golaszewski
                   ` (3 preceding siblings ...)
  2026-07-20  9:24 ` [PATCH 4/8] net: bcmgenet: " Bartosz Golaszewski
@ 2026-07-20  9:24 ` Bartosz Golaszewski
  2026-07-20 14:34   ` Frank Li
  2026-07-20  9:24 ` [PATCH 6/8] mfd: tps6586: " Bartosz Golaszewski
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-20  9:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla
  Cc: brgl, driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu,
	netdev, linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm,
	linux-sound, Bartosz Golaszewski

Prefer the higher-level platform_device_set_fwnode() over the
OF-specific platform_device_set_of_node() for dynamically allocated
platform devices.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/pmdomain/imx/gpc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pmdomain/imx/gpc.c b/drivers/pmdomain/imx/gpc.c
index abca5f449a226fbae4213926e1395c413160c950..c147eaf048ba2b79a744ec87029420981581e48e 100644
--- a/drivers/pmdomain/imx/gpc.c
+++ b/drivers/pmdomain/imx/gpc.c
@@ -487,7 +487,7 @@ static int imx_gpc_probe(struct platform_device *pdev)
 			domain->ipg_rate_mhz = ipg_rate_mhz;
 
 			pd_pdev->dev.parent = &pdev->dev;
-			platform_device_set_of_node(pd_pdev, np);
+			platform_device_set_fwnode(pd_pdev, of_fwnode_handle(np));
 
 			ret = platform_device_add(pd_pdev);
 			if (ret) {

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 6/8] mfd: tps6586: use platform_device_set_fwnode()
  2026-07-20  9:24 [PATCH 0/8] driver core: prefer platform_device_set_fwnode() Bartosz Golaszewski
                   ` (4 preceding siblings ...)
  2026-07-20  9:24 ` [PATCH 5/8] pmdomain: imx: " Bartosz Golaszewski
@ 2026-07-20  9:24 ` Bartosz Golaszewski
  2026-07-20  9:24 ` [PATCH 7/8] net: mv643xx: " Bartosz Golaszewski
  2026-07-20  9:24 ` [PATCH 8/8] slimbus: qcom-ngd-ctrl: " Bartosz Golaszewski
  7 siblings, 0 replies; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-20  9:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla
  Cc: brgl, driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu,
	netdev, linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm,
	linux-sound, Bartosz Golaszewski

Prefer the higher-level platform_device_set_fwnode() over the
OF-specific platform_device_set_of_node() for dynamically allocated
platform devices.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/mfd/tps6586x.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mfd/tps6586x.c b/drivers/mfd/tps6586x.c
index 3cfd2f02b62f3cc370e0d970ec2643b638fd0fec..fc7c4b55c385416741925904abae4fd240f55b13 100644
--- a/drivers/mfd/tps6586x.c
+++ b/drivers/mfd/tps6586x.c
@@ -397,7 +397,7 @@ static int tps6586x_add_subdevs(struct tps6586x *tps6586x,
 
 		pdev->dev.parent = tps6586x->dev;
 		pdev->dev.platform_data = subdev->platform_data;
-		platform_device_set_of_node(pdev, subdev->of_node);
+		platform_device_set_fwnode(pdev, of_fwnode_handle(subdev->of_node));
 
 		ret = platform_device_add(pdev);
 		if (ret) {

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 7/8] net: mv643xx: use platform_device_set_fwnode()
  2026-07-20  9:24 [PATCH 0/8] driver core: prefer platform_device_set_fwnode() Bartosz Golaszewski
                   ` (5 preceding siblings ...)
  2026-07-20  9:24 ` [PATCH 6/8] mfd: tps6586: " Bartosz Golaszewski
@ 2026-07-20  9:24 ` Bartosz Golaszewski
  2026-07-20 14:43   ` Andrew Lunn
  2026-07-20  9:24 ` [PATCH 8/8] slimbus: qcom-ngd-ctrl: " Bartosz Golaszewski
  7 siblings, 1 reply; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-20  9:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla
  Cc: brgl, driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu,
	netdev, linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm,
	linux-sound, Bartosz Golaszewski

Prefer the higher-level platform_device_set_fwnode() over the
OF-specific platform_device_set_of_node() for dynamically allocated
platform devices.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 9caa1e47c174c9d7a161b7f2e2ee12a829b813d4..2f2d6cce8d852b9ec3ab42678a04a7915d1f00cc 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2780,7 +2780,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
 		goto put_err;
 	}
 	ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
-	platform_device_set_of_node(ppdev, pnp);
+	platform_device_set_fwnode(ppdev, of_fwnode_handle(pnp));
 
 	ret = platform_device_add_resources(ppdev, &res, 1);
 	if (ret)

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [PATCH 8/8] slimbus: qcom-ngd-ctrl: use platform_device_set_fwnode()
  2026-07-20  9:24 [PATCH 0/8] driver core: prefer platform_device_set_fwnode() Bartosz Golaszewski
                   ` (6 preceding siblings ...)
  2026-07-20  9:24 ` [PATCH 7/8] net: mv643xx: " Bartosz Golaszewski
@ 2026-07-20  9:24 ` Bartosz Golaszewski
  7 siblings, 0 replies; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-20  9:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla
  Cc: brgl, driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu,
	netdev, linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm,
	linux-sound, Bartosz Golaszewski

Prefer the higher-level platform_device_set_fwnode() over the
OF-specific platform_device_set_of_node() for dynamically allocated
platform devices.

Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/slimbus/qcom-ngd-ctrl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index 934c44c5bc1a92fae98f52bccd12ed849379dca8..bf077f47c9ddd484c11f98b47d2d8d4daf78dcb7 100644
--- a/drivers/slimbus/qcom-ngd-ctrl.c
+++ b/drivers/slimbus/qcom-ngd-ctrl.c
@@ -1538,7 +1538,7 @@ static int of_qcom_slim_ngd_register(struct device *parent,
 			kfree(ngd);
 			return ret;
 		}
-		platform_device_set_of_node(ngd->pdev, node);
+		platform_device_set_fwnode(ngd->pdev, of_fwnode_handle(node));
 		ctrl->ngd = ngd;
 
 		ret = platform_device_add(ngd->pdev);

-- 
2.47.3


^ permalink raw reply related	[flat|nested] 21+ messages in thread

* Re: [PATCH 2/8] i2c: pxa-pci: use platform_device_set_fwnode()
  2026-07-20  9:24 ` [PATCH 2/8] i2c: pxa-pci: " Bartosz Golaszewski
@ 2026-07-20  9:41   ` Wolfram Sang
  0 siblings, 0 replies; 21+ messages in thread
From: Wolfram Sang @ 2026-07-20  9:41 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla, brgl, driver-core,
	linuxppc-dev, linux-kernel, linux-i2c, iommu, netdev, linux-pm,
	imx, linux-arm-kernel, mfd, linux-arm-msm, linux-sound

On Mon, Jul 20, 2026 at 11:24:49AM +0200, Bartosz Golaszewski wrote:
> Prefer the higher-level platform_device_set_fwnode() over the
> OF-specific platform_device_set_of_node() for dynamically allocated
> platform devices.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

Fine with me.

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Note that we still need Andi's ack.


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/8] iommu/fsl: use platform_device_set_fwnode()
  2026-07-20  9:24 ` [PATCH 3/8] iommu/fsl: " Bartosz Golaszewski
@ 2026-07-20 12:58   ` Robin Murphy
  2026-07-20 13:39     ` Bartosz Golaszewski
  2026-07-20 14:34   ` Frank Li
  1 sibling, 1 reply; 21+ messages in thread
From: Robin Murphy @ 2026-07-20 12:58 UTC (permalink / raw)
  To: Bartosz Golaszewski, Greg Kroah-Hartman, Rafael J. Wysocki,
	Danilo Krummrich, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy (CS GROUP), Andi Shyti,
	Joerg Roedel (AMD), Will Deacon, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla
  Cc: brgl, driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu,
	netdev, linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm,
	linux-sound

On 20/07/2026 10:24 am, Bartosz Golaszewski wrote:
> Prefer the higher-level platform_device_set_fwnode() over the
> OF-specific platform_device_set_of_node() for dynamically allocated
> platform devices.

This is very much non-portable code specific to OF-only platforms, but 
if the intention is to remove platform_device_set_of_node() again 
already, then FWIW,

Acked-by: Robin Murphy <robin.murphy@arm.com>

(Although I'm slightly puzzled by the cover letter - AFAICS in -next, 
platform_device_set_of_node() is itself very much a user of 
platform_device_set_fwnode(), however in terms of symbol exports, 
perhaps the former could now just be a static inline wrapper?)

> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
>   drivers/iommu/fsl_pamu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
> index c83bbc3faad56d6ee1c89b0a7f74028af02c81e9..268a1f752fbceab4fd24013aeea5df1b6982fbb1 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -975,7 +975,7 @@ static __init int fsl_pamu_init(void)
>   		goto error_device_alloc;
>   	}
>   
> -	platform_device_set_of_node(pdev, np);
> +	platform_device_set_fwnode(pdev, of_fwnode_handle(np));
>   
>   	ret = pamu_domain_init();
>   	if (ret)
> 


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/8] iommu/fsl: use platform_device_set_fwnode()
  2026-07-20 12:58   ` Robin Murphy
@ 2026-07-20 13:39     ` Bartosz Golaszewski
  2026-07-20 14:34       ` Robin Murphy
  0 siblings, 1 reply; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-20 13:39 UTC (permalink / raw)
  To: Robin Murphy
  Cc: brgl, driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu,
	netdev, linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm,
	linux-sound, Bartosz Golaszewski, Greg Kroah-Hartman,
	Rafael J. Wysocki, Danilo Krummrich, Madhavan Srinivasan,
	Michael Ellerman, Nicholas Piggin, Christophe Leroy (CS GROUP),
	Andi Shyti, Joerg Roedel (AMD), Will Deacon, Andy Shevchenko,
	Doug Berger, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Ulf Hansson, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Lee Jones, Sebastian Hesselbarth,
	Srinivas Kandagatla

On Mon, 20 Jul 2026 14:58:27 +0200, Robin Murphy <robin.murphy@arm.com> said:
> On 20/07/2026 10:24 am, Bartosz Golaszewski wrote:
>> Prefer the higher-level platform_device_set_fwnode() over the
>> OF-specific platform_device_set_of_node() for dynamically allocated
>> platform devices.
>
> This is very much non-portable code specific to OF-only platforms, but
> if the intention is to remove platform_device_set_of_node() again
> already, then FWIW,
>

Providing platform_device_set_of_node() and using it was done to make the
transision to expanding reference counting to all firmware nodes possible.
I don't think we'll remove it just yet as it doesn't make sense to convert
the code under drivers/of/ to using the fwnode variant.

> Acked-by: Robin Murphy <robin.murphy@arm.com>
>
> (Although I'm slightly puzzled by the cover letter - AFAICS in -next,
> platform_device_set_of_node() is itself very much a user of
> platform_device_set_fwnode(), however in terms of symbol exports,
> perhaps the former could now just be a static inline wrapper?)
>

Sure that can be done independently later.

Bart

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/8] iommu/fsl: use platform_device_set_fwnode()
  2026-07-20  9:24 ` [PATCH 3/8] iommu/fsl: " Bartosz Golaszewski
  2026-07-20 12:58   ` Robin Murphy
@ 2026-07-20 14:34   ` Frank Li
  1 sibling, 0 replies; 21+ messages in thread
From: Frank Li @ 2026-07-20 14:34 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla, brgl, driver-core,
	linuxppc-dev, linux-kernel, linux-i2c, iommu, netdev, linux-pm,
	imx, linux-arm-kernel, mfd, linux-arm-msm, linux-sound

On Mon, Jul 20, 2026 at 11:24:50AM +0200, Bartosz Golaszewski wrote:
> Prefer the higher-level platform_device_set_fwnode() over the
> OF-specific platform_device_set_of_node() for dynamically allocated
> platform devices.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/iommu/fsl_pamu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/fsl_pamu.c b/drivers/iommu/fsl_pamu.c
> index c83bbc3faad56d6ee1c89b0a7f74028af02c81e9..268a1f752fbceab4fd24013aeea5df1b6982fbb1 100644
> --- a/drivers/iommu/fsl_pamu.c
> +++ b/drivers/iommu/fsl_pamu.c
> @@ -975,7 +975,7 @@ static __init int fsl_pamu_init(void)
>  		goto error_device_alloc;
>  	}
>
> -	platform_device_set_of_node(pdev, np);
> +	platform_device_set_fwnode(pdev, of_fwnode_handle(np));
>
>  	ret = pamu_domain_init();
>  	if (ret)
>
> --
> 2.47.3
>
>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 3/8] iommu/fsl: use platform_device_set_fwnode()
  2026-07-20 13:39     ` Bartosz Golaszewski
@ 2026-07-20 14:34       ` Robin Murphy
  0 siblings, 0 replies; 21+ messages in thread
From: Robin Murphy @ 2026-07-20 14:34 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: driver-core, linuxppc-dev, linux-kernel, linux-i2c, iommu, netdev,
	linux-pm, imx, linux-arm-kernel, mfd, linux-arm-msm, linux-sound,
	Bartosz Golaszewski, Greg Kroah-Hartman, Rafael J. Wysocki,
	Danilo Krummrich, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy (CS GROUP), Andi Shyti,
	Joerg Roedel (AMD), Will Deacon, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla

On 20/07/2026 2:39 pm, Bartosz Golaszewski wrote:
> On Mon, 20 Jul 2026 14:58:27 +0200, Robin Murphy <robin.murphy@arm.com> said:
>> On 20/07/2026 10:24 am, Bartosz Golaszewski wrote:
>>> Prefer the higher-level platform_device_set_fwnode() over the
>>> OF-specific platform_device_set_of_node() for dynamically allocated
>>> platform devices.
>>
>> This is very much non-portable code specific to OF-only platforms, but
>> if the intention is to remove platform_device_set_of_node() again
>> already, then FWIW,
>>
> 
> Providing platform_device_set_of_node() and using it was done to make the
> transision to expanding reference counting to all firmware nodes possible.
> I don't think we'll remove it just yet as it doesn't make sense to convert
> the code under drivers/of/ to using the fwnode variant.

OK, but in that case why convert these users either? If the OF helper 
does continue to exist then I'd imagine the static checker brigade will 
eventually end up sending patches to "simplify" these open-coded 
equivalents back to using it. And frankly, if drivers do know for sure 
they're exclusively dealing with of_nodes, rather than doing something 
conditional under an is_of_node() check, then I see little justification 
for them *not* using the dedicated helper.

If the complaint is that there are no *public* users to justify 
exporting platform_device_set_fwnode(), then as I say AFAICS that's much 
more neatly addressed with the static inline approach, such that we 
still get to unify the public APIs, actively eliminate something from 
the symbol table and save a bit of source and object code, but without 
any need to churn the truly OF-based callers at all.

Thanks,
Robin.

> 
>> Acked-by: Robin Murphy <robin.murphy@arm.com>
>>
>> (Although I'm slightly puzzled by the cover letter - AFAICS in -next,
>> platform_device_set_of_node() is itself very much a user of
>> platform_device_set_fwnode(), however in terms of symbol exports,
>> perhaps the former could now just be a static inline wrapper?)
>>
> 
> Sure that can be done independently later.
> 
> Bart


^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 5/8] pmdomain: imx: use platform_device_set_fwnode()
  2026-07-20  9:24 ` [PATCH 5/8] pmdomain: imx: " Bartosz Golaszewski
@ 2026-07-20 14:34   ` Frank Li
  0 siblings, 0 replies; 21+ messages in thread
From: Frank Li @ 2026-07-20 14:34 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla, brgl, driver-core,
	linuxppc-dev, linux-kernel, linux-i2c, iommu, netdev, linux-pm,
	imx, linux-arm-kernel, mfd, linux-arm-msm, linux-sound

On Mon, Jul 20, 2026 at 11:24:52AM +0200, Bartosz Golaszewski wrote:
> Prefer the higher-level platform_device_set_fwnode() over the
> OF-specific platform_device_set_of_node() for dynamically allocated
> platform devices.
>
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
>  drivers/pmdomain/imx/gpc.c | 2 +-

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pmdomain/imx/gpc.c b/drivers/pmdomain/imx/gpc.c
> index abca5f449a226fbae4213926e1395c413160c950..c147eaf048ba2b79a744ec87029420981581e48e 100644
> --- a/drivers/pmdomain/imx/gpc.c
> +++ b/drivers/pmdomain/imx/gpc.c
> @@ -487,7 +487,7 @@ static int imx_gpc_probe(struct platform_device *pdev)
>  			domain->ipg_rate_mhz = ipg_rate_mhz;
>
>  			pd_pdev->dev.parent = &pdev->dev;
> -			platform_device_set_of_node(pd_pdev, np);
> +			platform_device_set_fwnode(pd_pdev, of_fwnode_handle(np));
>
>  			ret = platform_device_add(pd_pdev);
>  			if (ret) {
>
> --
> 2.47.3
>
>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 4/8] net: bcmgenet: use platform_device_set_fwnode()
  2026-07-20  9:24 ` [PATCH 4/8] net: bcmgenet: " Bartosz Golaszewski
@ 2026-07-20 14:38   ` Andrew Lunn
  2026-07-20 16:57     ` Florian Fainelli
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2026-07-20 14:38 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla, brgl, driver-core,
	linuxppc-dev, linux-kernel, linux-i2c, iommu, netdev, linux-pm,
	imx, linux-arm-kernel, mfd, linux-arm-msm, linux-sound

On Mon, Jul 20, 2026 at 11:24:51AM +0200, Bartosz Golaszewski wrote:
> Prefer the higher-level platform_device_set_fwnode() over the
> OF-specific platform_device_set_of_node() for dynamically allocated
> platform devices.

Why?

This driver is OF only. It does not support ACPI, and probably never
will. In general, networking and ACPI don't go together, ACPI is not
sufficiently advanced.

What is you use case here?

	Andrew

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 7/8] net: mv643xx: use platform_device_set_fwnode()
  2026-07-20  9:24 ` [PATCH 7/8] net: mv643xx: " Bartosz Golaszewski
@ 2026-07-20 14:43   ` Andrew Lunn
  2026-07-20 16:01     ` Bartosz Golaszewski
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2026-07-20 14:43 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Ulf Hansson, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Lee Jones,
	Sebastian Hesselbarth, Srinivas Kandagatla, brgl, driver-core,
	linuxppc-dev, linux-kernel, linux-i2c, iommu, netdev, linux-pm,
	imx, linux-arm-kernel, mfd, linux-arm-msm, linux-sound

On Mon, Jul 20, 2026 at 11:24:54AM +0200, Bartosz Golaszewski wrote:
> Prefer the higher-level platform_device_set_fwnode() over the
> OF-specific platform_device_set_of_node() for dynamically allocated
> platform devices.
> 
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> ---
>  drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> index 9caa1e47c174c9d7a161b7f2e2ee12a829b813d4..2f2d6cce8d852b9ec3ab42678a04a7915d1f00cc 100644
> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> @@ -2780,7 +2780,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
>  		goto put_err;
>  	}
>  	ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> -	platform_device_set_of_node(ppdev, pnp);
> +	platform_device_set_fwnode(ppdev, of_fwnode_handle(pnp));

This is definitely an OF only driver. There are no other calls to
fwnode functions in this driver, so this is the wrong thing to do.

Sorry, NACK.

       Andrew

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 7/8] net: mv643xx: use platform_device_set_fwnode()
  2026-07-20 14:43   ` Andrew Lunn
@ 2026-07-20 16:01     ` Bartosz Golaszewski
  2026-07-20 18:28       ` Andrew Lunn
  0 siblings, 1 reply; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-20 16:01 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Bartosz Golaszewski, Greg Kroah-Hartman, Rafael J. Wysocki,
	Danilo Krummrich, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy (CS GROUP), Andi Shyti,
	Joerg Roedel (AMD), Will Deacon, Robin Murphy, Andy Shevchenko,
	Doug Berger, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Ulf Hansson, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Lee Jones, Sebastian Hesselbarth,
	Srinivas Kandagatla, brgl, driver-core, linuxppc-dev,
	linux-kernel, linux-i2c, iommu, netdev, linux-pm, imx,
	linux-arm-kernel, mfd, linux-arm-msm, linux-sound

On Mon, 20 Jul 2026 16:43:40 +0200, Andrew Lunn <andrew@lunn.ch> said:
> On Mon, Jul 20, 2026 at 11:24:54AM +0200, Bartosz Golaszewski wrote:
>> Prefer the higher-level platform_device_set_fwnode() over the
>> OF-specific platform_device_set_of_node() for dynamically allocated
>> platform devices.
>>
>> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
>> ---
>>  drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
>> index 9caa1e47c174c9d7a161b7f2e2ee12a829b813d4..2f2d6cce8d852b9ec3ab42678a04a7915d1f00cc 100644
>> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
>> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
>> @@ -2780,7 +2780,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
>>  		goto put_err;
>>  	}
>>  	ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
>> -	platform_device_set_of_node(ppdev, pnp);
>> +	platform_device_set_fwnode(ppdev, of_fwnode_handle(pnp));
>
> This is definitely an OF only driver. There are no other calls to
> fwnode functions in this driver, so this is the wrong thing to do.
>
> Sorry, NACK.
>

I'm not going to die on this hill but drivers are OF-only until they're not.
For example, Qualcomm is now working on a hybrid ACPI-OF approach for
laptops[1] and we may end up needing to start converting drivers to fwnode
after all.

There's no real benefit to sticking to OF-specific APIs unless you need to
iterate over all properties of a node or use some other functionality not
available in fwnode. The overhead is minimal and it's never a hot path.

Thanks,
Bartosz

[1] https://lore.kernel.org/all/20260623145225.143218-1-johannes.goede@oss.qualcomm.com/

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 4/8] net: bcmgenet: use platform_device_set_fwnode()
  2026-07-20 14:38   ` Andrew Lunn
@ 2026-07-20 16:57     ` Florian Fainelli
  0 siblings, 0 replies; 21+ messages in thread
From: Florian Fainelli @ 2026-07-20 16:57 UTC (permalink / raw)
  To: Andrew Lunn, Bartosz Golaszewski
  Cc: Greg Kroah-Hartman, Rafael J. Wysocki, Danilo Krummrich,
	Madhavan Srinivasan, Michael Ellerman, Nicholas Piggin,
	Christophe Leroy (CS GROUP), Andi Shyti, Joerg Roedel (AMD),
	Will Deacon, Robin Murphy, Andy Shevchenko, Doug Berger,
	Broadcom internal kernel review list, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Ulf Hansson, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Lee Jones, Sebastian Hesselbarth,
	Srinivas Kandagatla, brgl, driver-core, linuxppc-dev,
	linux-kernel, linux-i2c, iommu, netdev, linux-pm, imx,
	linux-arm-kernel, mfd, linux-arm-msm, linux-sound

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

On 7/20/26 07:38, Andrew Lunn wrote:
> On Mon, Jul 20, 2026 at 11:24:51AM +0200, Bartosz Golaszewski wrote:
>> Prefer the higher-level platform_device_set_fwnode() over the
>> OF-specific platform_device_set_of_node() for dynamically allocated
>> platform devices.
> 
> Why?
> 
> This driver is OF only. It does not support ACPI, and probably never
> will. In general, networking and ACPI don't go together, ACPI is not
> sufficiently advanced.
> 
> What is you use case here?

The driver has been, or was used on ACPI-based platforms:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=99c6b06a37d4cab118c45448fef9d28df62d35d8
-- 
Florian

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5485 bytes --]

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 7/8] net: mv643xx: use platform_device_set_fwnode()
  2026-07-20 16:01     ` Bartosz Golaszewski
@ 2026-07-20 18:28       ` Andrew Lunn
  2026-07-21  7:57         ` Bartosz Golaszewski
  0 siblings, 1 reply; 21+ messages in thread
From: Andrew Lunn @ 2026-07-20 18:28 UTC (permalink / raw)
  To: Bartosz Golaszewski
  Cc: Bartosz Golaszewski, Greg Kroah-Hartman, Rafael J. Wysocki,
	Danilo Krummrich, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy (CS GROUP), Andi Shyti,
	Joerg Roedel (AMD), Will Deacon, Robin Murphy, Andy Shevchenko,
	Doug Berger, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Ulf Hansson, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Lee Jones, Sebastian Hesselbarth,
	Srinivas Kandagatla, driver-core, linuxppc-dev, linux-kernel,
	linux-i2c, iommu, netdev, linux-pm, imx, linux-arm-kernel, mfd,
	linux-arm-msm, linux-sound

On Mon, Jul 20, 2026 at 06:01:37PM +0200, Bartosz Golaszewski wrote:
> On Mon, 20 Jul 2026 16:43:40 +0200, Andrew Lunn <andrew@lunn.ch> said:
> > On Mon, Jul 20, 2026 at 11:24:54AM +0200, Bartosz Golaszewski wrote:
> >> Prefer the higher-level platform_device_set_fwnode() over the
> >> OF-specific platform_device_set_of_node() for dynamically allocated
> >> platform devices.
> >>
> >> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
> >> ---
> >>  drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
> >> index 9caa1e47c174c9d7a161b7f2e2ee12a829b813d4..2f2d6cce8d852b9ec3ab42678a04a7915d1f00cc 100644
> >> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
> >> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
> >> @@ -2780,7 +2780,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
> >>  		goto put_err;
> >>  	}
> >>  	ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
> >> -	platform_device_set_of_node(ppdev, pnp);
> >> +	platform_device_set_fwnode(ppdev, of_fwnode_handle(pnp));
> >
> > This is definitely an OF only driver. There are no other calls to
> > fwnode functions in this driver, so this is the wrong thing to do.
> >
> > Sorry, NACK.
> >
> 
> I'm not going to die on this hill but drivers are OF-only until they're not.
> For example, Qualcomm is now working on a hybrid ACPI-OF approach for
> laptops[1] and we may end up needing to start converting drivers to fwnode
> after all.
> 
> There's no real benefit to sticking to OF-specific APIs unless you need to
> iterate over all properties of a node or use some other functionality not
> available in fwnode. The overhead is minimal and it's never a hot path.

There is a lot of benefit to sticking to OF specific APIs, because
within the kernel OF is well maintained, has active maintainers, there
are tools to validate bindings, etc. ACPI is a Wild West, each driver
is a snow flake, there is no review, no binding documentation, no
validation tools etc.

I hope you allow plenty of time to convert any networking drivers,
where Linux is driving the hardware, to ACPI. Your first stop will be
the UEFI forum making a proposal for MDIO busses, because that
currently is not part of ACPI. You will then need to spend time
understanding the DT bindings, and figuring out which properties are
deprecated so need to stay OF only, and which can be converted to dual
OF/ACPI. I've seen too many naive attempts which blindly convert
everything, copying all the past errors in the DT binding into the
brand new ACPI binding. That will get NACKed.

OF != ACPI

	Andrew

^ permalink raw reply	[flat|nested] 21+ messages in thread

* Re: [PATCH 7/8] net: mv643xx: use platform_device_set_fwnode()
  2026-07-20 18:28       ` Andrew Lunn
@ 2026-07-21  7:57         ` Bartosz Golaszewski
  0 siblings, 0 replies; 21+ messages in thread
From: Bartosz Golaszewski @ 2026-07-21  7:57 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Bartosz Golaszewski, Greg Kroah-Hartman, Rafael J. Wysocki,
	Danilo Krummrich, Madhavan Srinivasan, Michael Ellerman,
	Nicholas Piggin, Christophe Leroy (CS GROUP), Andi Shyti,
	Joerg Roedel (AMD), Will Deacon, Robin Murphy, Andy Shevchenko,
	Doug Berger, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Ulf Hansson, Frank Li, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Lee Jones, Sebastian Hesselbarth,
	Srinivas Kandagatla, driver-core, linuxppc-dev, linux-kernel,
	linux-i2c, iommu, netdev, linux-pm, imx, linux-arm-kernel, mfd,
	linux-arm-msm, linux-sound, Bartosz Golaszewski

On Mon, 20 Jul 2026 20:28:39 +0200, Andrew Lunn <andrew@lunn.ch> said:
> On Mon, Jul 20, 2026 at 06:01:37PM +0200, Bartosz Golaszewski wrote:
>> On Mon, 20 Jul 2026 16:43:40 +0200, Andrew Lunn <andrew@lunn.ch> said:
>> > On Mon, Jul 20, 2026 at 11:24:54AM +0200, Bartosz Golaszewski wrote:
>> >> Prefer the higher-level platform_device_set_fwnode() over the
>> >> OF-specific platform_device_set_of_node() for dynamically allocated
>> >> platform devices.
>> >>
>> >> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
>> >> ---
>> >>  drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
>> >>  1 file changed, 1 insertion(+), 1 deletion(-)
>> >>
>> >> diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
>> >> index 9caa1e47c174c9d7a161b7f2e2ee12a829b813d4..2f2d6cce8d852b9ec3ab42678a04a7915d1f00cc 100644
>> >> --- a/drivers/net/ethernet/marvell/mv643xx_eth.c
>> >> +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
>> >> @@ -2780,7 +2780,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
>> >>  		goto put_err;
>> >>  	}
>> >>  	ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
>> >> -	platform_device_set_of_node(ppdev, pnp);
>> >> +	platform_device_set_fwnode(ppdev, of_fwnode_handle(pnp));
>> >
>> > This is definitely an OF only driver. There are no other calls to
>> > fwnode functions in this driver, so this is the wrong thing to do.
>> >
>> > Sorry, NACK.
>> >
>>
>> I'm not going to die on this hill but drivers are OF-only until they're not.
>> For example, Qualcomm is now working on a hybrid ACPI-OF approach for
>> laptops[1] and we may end up needing to start converting drivers to fwnode
>> after all.
>>
>> There's no real benefit to sticking to OF-specific APIs unless you need to
>> iterate over all properties of a node or use some other functionality not
>> available in fwnode. The overhead is minimal and it's never a hot path.
>
> There is a lot of benefit to sticking to OF specific APIs, because
> within the kernel OF is well maintained, has active maintainers, there
> are tools to validate bindings, etc. ACPI is a Wild West, each driver
> is a snow flake, there is no review, no binding documentation, no
> validation tools etc.
>
> I hope you allow plenty of time to convert any networking drivers,
> where Linux is driving the hardware, to ACPI. Your first stop will be
> the UEFI forum making a proposal for MDIO busses, because that
> currently is not part of ACPI. You will then need to spend time
> understanding the DT bindings, and figuring out which properties are
> deprecated so need to stay OF only, and which can be converted to dual
> OF/ACPI. I've seen too many naive attempts which blindly convert
> everything, copying all the past errors in the DT binding into the
> brand new ACPI binding. That will get NACKed.
>
> OF != ACPI
>

I've never said that and ACPI is actually irrelevant to this discussion. Fwnode
is the abstraction layer and OF happens to implement it. Unless you need
fine-grained control (only exposed by the lower-level abstraction) or
performance - neither of which is the case here - you should use the top-level
API. As I said: there's no good reason to stick to OF-specific interfaces for
drivers that don't really require it - and even then, we should strive to fill
the gaps in the fwnode API instead.

Bart

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2026-07-21  7:58 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-20  9:24 [PATCH 0/8] driver core: prefer platform_device_set_fwnode() Bartosz Golaszewski
2026-07-20  9:24 ` [PATCH 1/8] powerpc/powermac: use platform_device_set_fwnode() Bartosz Golaszewski
2026-07-20  9:24 ` [PATCH 2/8] i2c: pxa-pci: " Bartosz Golaszewski
2026-07-20  9:41   ` Wolfram Sang
2026-07-20  9:24 ` [PATCH 3/8] iommu/fsl: " Bartosz Golaszewski
2026-07-20 12:58   ` Robin Murphy
2026-07-20 13:39     ` Bartosz Golaszewski
2026-07-20 14:34       ` Robin Murphy
2026-07-20 14:34   ` Frank Li
2026-07-20  9:24 ` [PATCH 4/8] net: bcmgenet: " Bartosz Golaszewski
2026-07-20 14:38   ` Andrew Lunn
2026-07-20 16:57     ` Florian Fainelli
2026-07-20  9:24 ` [PATCH 5/8] pmdomain: imx: " Bartosz Golaszewski
2026-07-20 14:34   ` Frank Li
2026-07-20  9:24 ` [PATCH 6/8] mfd: tps6586: " Bartosz Golaszewski
2026-07-20  9:24 ` [PATCH 7/8] net: mv643xx: " Bartosz Golaszewski
2026-07-20 14:43   ` Andrew Lunn
2026-07-20 16:01     ` Bartosz Golaszewski
2026-07-20 18:28       ` Andrew Lunn
2026-07-21  7:57         ` Bartosz Golaszewski
2026-07-20  9:24 ` [PATCH 8/8] slimbus: qcom-ngd-ctrl: " Bartosz Golaszewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox