Skip to content

Commit

Permalink
of/platform: Initialise dev->fwnode appropriately
Browse files Browse the repository at this point in the history
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 <robin.murphy@arm.com>
Signed-off-by: Rob Herring <robh@kernel.org>
  • Loading branch information
Robin Murphy authored and Rob Herring committed Sep 15, 2016
1 parent a67e947 commit f94277a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/of/platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ struct platform_device *of_device_alloc(struct device_node *np,
}

dev->dev.of_node = of_node_get(np);
dev->dev.fwnode = &np->fwnode;
dev->dev.parent = parent ? : &platform_bus;

if (bus_id)
Expand Down Expand Up @@ -241,6 +242,7 @@ static struct amba_device *of_amba_device_create(struct device_node *node,

/* setup generic device info */
dev->dev.of_node = of_node_get(node);
dev->dev.fwnode = &node->fwnode;
dev->dev.parent = parent ? : &platform_bus;
dev->dev.platform_data = platform_data;
if (bus_id)
Expand Down

0 comments on commit f94277a

Please sign in to comment.