summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-05-04 11:58:23 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-05-04 12:56:56 +0200
commitb30047b433a60e6183216e8364971efddd5d208e (patch)
tree0bb76813f6e7278831ae2ca166f6e9c64e57572c
parent08905f2a44d02efcf4bb243c9f838241ecbd2c86 (diff)
downloadbarebox-b30047b433a60e6183216e8364971efddd5d208e.tar.gz
barebox-b30047b433a60e6183216e8364971efddd5d208e.tar.xz
state: warn when a state node will be overwritten
People do not seem to know that a state node in the kernel device tree will be overwritten by barebox. Print a warning when this happens so that people can get an idea why changes in the kernel device tree state node do not have any effect. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--common/state/state.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/common/state/state.c b/common/state/state.c
index 6db77f2c18..c3c8b768c7 100644
--- a/common/state/state.c
+++ b/common/state/state.c
@@ -416,6 +416,15 @@ static int of_state_fixup(struct device_node *root, void *ctx)
if (node) {
/* replace existing node - it will be deleted later */
parent = node->parent;
+
+ /*
+ * barebox replaces the state node in the device tree it starts the
+ * kernel with, so a state node that already exists in the device tree
+ * will be overwritten. Warn about this so people do not wonder why
+ * changes in the kernels state node do not have any effect.
+ */
+ if (root != of_get_root_node())
+ dev_warn(&state->dev, "Warning: Kernel devicetree contains state node, replacing it\n");
} else {
char *of_path, *c;