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 16:14:02 +0100 |
commit | 2413464c9cceb1a0a825fe7aacaa63a71847c99f (patch) | |
tree | ea013520ae851d913473b34f50334c706b363010 | |
parent | 60bc22ab87825d102639ab5977a8340861e4a7ac (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; |