mfd: core: Set fwnode for created devices
authorRobert Hancock <hancock@sedsystems.ca>
Tue, 4 Jun 2019 22:35:43 +0000 (16:35 -0600)
committerLee Jones <lee.jones@linaro.org>
Tue, 2 Jul 2019 11:11:31 +0000 (12:11 +0100)
The logic for setting the of_node on devices created by mfd did not set
the fwnode pointer to match, which caused fwnode-based APIs to
malfunction on these devices since the fwnode pointer was null. Fix
this.

Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/mfd-core.c

index 1ade4c8cc91f7dbd185f1b84ccaf815a55c9cd70..9ce909b821ecc7e0ee6bc4b3070894606d40a73a 100644 (file)
@@ -179,6 +179,7 @@ static int mfd_add_device(struct device *parent, int id,
                for_each_child_of_node(parent->of_node, np) {
                        if (of_device_is_compatible(np, cell->of_compatible)) {
                                pdev->dev.of_node = np;
+                               pdev->dev.fwnode = &np->fwnode;
                                break;
                        }
                }