diff options
author | Ulrich Ölmann <u.oelmann@pengutronix.de> | 2018-12-18 14:57:35 +0100 |
---|---|---|
committer | Roland Hieber <rhi@pengutronix.de> | 2019-01-07 12:26:49 +0100 |
commit | d6968e389ba869aff6958e667ac3e959cad284f8 (patch) | |
tree | 9ab0a75a35e9f05fbb085f034fb64a9b31aa81e7 | |
parent | 52ffce4648f33dc81e4954400ef1c9fa88aa7192 (diff) | |
download | dt-utils-d6968e389ba869aff6958e667ac3e959cad284f8.tar.gz dt-utils-d6968e389ba869aff6958e667ac3e959cad284f8.tar.xz |
state: warn when a state node will be overwritten
This ports the following barebox commit:
| commit b30047b433a60e6183216e8364971efddd5d208e
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date: Thu May 4 11:58:23 2017 +0200
|
| 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>
Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Signed-off-by: Roland Hieber <rhi@pengutronix.de>
-rw-r--r-- | src/barebox-state/state.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/barebox-state/state.c b/src/barebox-state/state.c index 9c4edb3..fda51db 100644 --- a/src/barebox-state/state.c +++ b/src/barebox-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; |