Skip to contentSkip to conversation

mfd: core: Make use of device_set_node()

PATCH Applied Andy Shevchenko 3 participants 3 messages May 30, 2024 – May 31, 2024 Multifunction devices (MFD)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mfd: core: Make use of device_set_node()

Use device_set_node() instead of assigning pdev->dev.of_node directly because it also sets the firmware node.

---
 drivers/mfd/mfd-core.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/mfd/mfd-core.c +2 -3
index 6ad5c93027af..7ea9a875d8f3 100644
@@ -87,7 +87,7 @@ static void mfd_acpi_add_device(const struct mfd_cell *cell,
 		}
 	}
 
-	ACPI_COMPANION_SET(&pdev->dev, adev ?: parent);
+	device_set_node(&pdev->dev, acpi_fwnode_handle(adev ?: parent));
 }
 #else
 static inline void mfd_acpi_add_device(const struct mfd_cell *cell,
@@ -131,8 +131,7 @@ static int mfd_match_of_node_to_dev(struct platform_device *pdev,
 	of_entry->np = np;
 	list_add_tail(&of_entry->list, &mfd_of_node_list);
 
-	pdev->dev.of_node = np;
-	pdev->dev.fwnode = &np->fwnode;
+	device_set_node(&pdev->dev, of_fwnode_handle(np));
 #endif
 	return 0;
 }
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
maintainer Applied
#2 lore raw

Re: (subset) [PATCH v1 1/1] mfd: core: Make use of device_set_node()

In reply to Andy Shevchenko
Quoted 4 lines · Andy Shevchenko

Use device_set_node() instead of assigning pdev->dev.of_node directly because it also sets the firmware node.

Applied, thanks!

[1/1] mfd: core: Make use of device_set_node()

      commit: 03ab12796acff74d1c0e8278569499f989134377

--
Lee Jones [李琼斯]