From fa97a0ec99b021de2e6a175dc74925124b104aa5 Mon Sep 17 00:00:00 2001 From: Robin Murphy Date: Wed, 14 Sep 2016 16:01:24 +0100 Subject: [PATCH] UPSTREAM: 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 Signed-off-by: Rob Herring (cherry picked from commit f94277af03ead0d3bf24a190a44d2b4cd6016549) Signed-off-by: Brian J Lovin BUG=b:64133998 TEST=media device topology shows subdevs registered successfully TEST=no camera regression Change-Id: I4f26ee5173a04fac70b013948d19c89d1c4e5da3 Reviewed-on: https://chromium-review.googlesource.com/693674 Commit-Ready: Tomasz Figa Tested-by: Hyungwoo Yang Reviewed-by: Tomasz Figa Signed-off-by: Jacob Chen --- drivers/of/platform.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/of/platform.c b/drivers/of/platform.c index af98343614d8..f151be5a057c 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 = &np->fwnode; dev->dev.parent = parent ? : &platform_bus; if (bus_id) @@ -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)