Skip to content

Commit f94277a

Browse files
rmurphy-armrobherring
authored andcommitted
of/platform: Initialise dev->fwnode appropriately
Whilst we're some of the way towards a universal firmware property interface, drivers which deal with both OF and ACPI probing end up having to do things like this: dev->of_node ? &dev->of_node->fwnode : dev->fwnode This seems unnecessary, when the OF code could instead simply fill in the device's fwnode when binding the of_node, and let the drivers use dev->fwnode either way. Let's give it a go and see what falls out. Signed-off-by: Robin Murphy <[email protected]> Signed-off-by: Rob Herring <[email protected]>
1 parent a67e947 commit f94277a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/of/platform.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ struct platform_device *of_device_alloc(struct device_node *np,
142142
}
143143

144144
dev->dev.of_node = of_node_get(np);
145+
dev->dev.fwnode = &np->fwnode;
145146
dev->dev.parent = parent ? : &platform_bus;
146147

147148
if (bus_id)
@@ -241,6 +242,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node,
241242

242243
/* setup generic device info */
243244
dev->dev.of_node = of_node_get(node);
245+
dev->dev.fwnode = &node->fwnode;
244246
dev->dev.parent = parent ? : &platform_bus;
245247
dev->dev.platform_data = platform_data;
246248
if (bus_id)

0 commit comments

Comments
 (0)