diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2016-01-21 13:49:48 +0100 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2016-03-08 15:52:39 +0100 |
commit | fac307f3e0f8cf5276f58b82610881bbcea1b6a6 (patch) | |
tree | ef94ba6cc55be14be80eaec80d948423cd5f7c93 | |
parent | 5513b2dd533e6141deda582651bc6798c2f01b18 (diff) |
of: fill in new type field on node creation
The backport of the extcon subsystem also brought a new field in
the of node structure. Set it correctly or code using it will
think the node comes from ACPI, not from a device-tree.
Fixes gpio-leds which otherwise would not find the gpios from the
device tree.
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
-rw-r--r-- | drivers/of/fdt.c | 6 | ||||
-rw-r--r-- | drivers/of/pdt.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 96ad1ab7f9d6..3531a43d7d3e 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -202,6 +202,12 @@ static void * unflatten_dt_node(struct boot_param_header *blob, __alignof__(struct device_node)); if (allnextpp) { char *fn; + + /* of_node_init(np); throws runtime errors + * 'tried to init an initialized object' + * thus only set the type here. Sideeffect from backporting extcon */ + np->fwnode.type = FWNODE_OF; + np->full_name = fn = ((char *)np) + sizeof(*np); if (new_format) { /* rebuild full path for new format */ diff --git a/drivers/of/pdt.c b/drivers/of/pdt.c index e64fa3d3da5f..38de38601429 100644 --- a/drivers/of/pdt.c +++ b/drivers/of/pdt.c @@ -176,6 +176,11 @@ static struct device_node * __init of_pdt_create_node(phandle node, return NULL; dp = prom_early_alloc(sizeof(*dp)); + /* of_node_init(np); likely will throw runtime errors + * 'tried to init an initialized object' + * thus only set the type here. Sideeffect from backporting extcon */ + np->fwnode.type = FWNODE_OF; + of_pdt_incr_unique_id(dp); dp->parent = parent; |