diff mbox

[06/13] of/platform: Set fwnode field for new devices

Message ID 1434548543-22949-7-git-send-email-tomeu.vizoso@collabora.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomeu Vizoso June 17, 2015, 1:42 p.m. UTC
When allocating a new platform device, set the fwnode field in the
struct device to point to the device_node.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---
 drivers/of/platform.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Mark Brown June 17, 2015, 5:27 p.m. UTC | #1
On Wed, Jun 17, 2015 at 03:42:16PM +0200, Tomeu Vizoso wrote:

> When allocating a new platform device, set the fwnode field in the
> struct device to point to the device_node.

Why?
diff mbox

Patch

diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index ddf8e42..e880f55 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -139,6 +139,7 @@  struct platform_device *of_device_alloc(struct device_node *np,
 	}
 
 	dev->dev.of_node = of_node_get(np);
+	dev->dev.fwnode = &dev->dev.of_node->fwnode;
 	dev->dev.parent = parent ? : &platform_bus;
 
 	if (bus_id)