From 5b84ef0b029eb488c6a8fd83eea37010ac63b5e1 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Mon, 6 Jul 2026 14:44:16 +0200 Subject: driver core: platform: provide platform_device_set_of_node_from_dev() Provide a platform-specific variant of device_set_of_node_from_dev(). In addition to bumping the reference count of the OF node being assigned, it also assigns the fwnode of the platform device. Reviewed-by: Andy Shevchenko Signed-off-by: Bartosz Golaszewski Link: https://patch.msgid.link/20260706-pdev-fwnode-ref-v3-4-1ff028e33779@oss.qualcomm.com Signed-off-by: Greg Kroah-Hartman --- include/linux/platform_device.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index c463d46b7b9a..94b8d2b46e91 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h @@ -268,6 +268,8 @@ void platform_device_set_of_node(struct platform_device *pdev, struct device_node *np); void platform_device_set_fwnode(struct platform_device *pdev, struct fwnode_handle *fwnode); +void platform_device_set_of_node_from_dev(struct platform_device *pdev, + const struct device *dev2); extern int platform_device_add(struct platform_device *pdev); extern void platform_device_del(struct platform_device *pdev); extern void platform_device_put(struct platform_device *pdev); -- cgit v1.2.3