Ahead of reworking the reference counting logic for platform devices,
encapsulate the assignment of the OF node for dynamically allocated
platform devices with the provided helper.

Signed-off-by: Bartosz Golaszewski <[email protected]>
---
 drivers/of/platform.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 
a42224f9d1a888a6e6cad7534cd2c5f110e995da..db45d1e99bf9b027548aac3a15bf754b3c023161
 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -126,7 +126,7 @@ struct platform_device *of_device_alloc(struct device_node 
*np,
        }
 
        /* setup generic device info */
-       device_set_node(&dev->dev, of_fwnode_handle(of_node_get(np)));
+       platform_device_set_of_node(dev, np);
        dev->dev.parent = parent ? : &platform_bus;
 
        if (bus_id)

-- 
2.47.3


Reply via email to