diff options
author | Ulrich Ölmann <u.oelmann@pengutronix.de> | 2018-12-18 14:57:36 +0100 |
---|---|---|
committer | Roland Hieber <rhi@pengutronix.de> | 2019-01-07 12:26:50 +0100 |
commit | 19f3bb5c06006b63adb8161116bd85f390a5f14c (patch) | |
tree | 7eb408521699f332c93ace8804d806cf592fda20 | |
parent | d6968e389ba869aff6958e667ac3e959cad284f8 (diff) | |
download | dt-utils-19f3bb5c06006b63adb8161116bd85f390a5f14c.tar.gz dt-utils-19f3bb5c06006b63adb8161116bd85f390a5f14c.tar.xz |
state: Make an alias mandatory
This ports the following barebox commit:
| commit 49831918036ab3292870dc2c6035292e6af47ae1
| Author: Sascha Hauer <s.hauer@pengutronix.de>
| Date: Thu May 4 12:27:21 2017 +0200
|
| state: Make an alias mandatory
|
| The userspace barebox-state utility gets confused when no alias exists.
| Make the alias mandatory, so that people make it right^tm without having
| to ask.
|
| 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 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/barebox-state/state.c b/src/barebox-state/state.c index fda51db..9b658be 100644 --- a/src/barebox-state/state.c +++ b/src/barebox-state/state.c @@ -567,8 +567,10 @@ struct state *state_new_from_node(struct device_node *node, char *path, uint32_t stridesize; alias = of_alias_get(node); - if (!alias) - alias = node->name; + if (!alias) { + pr_err("State node %s does not have an alias in the /aliases/ node\n", node->full_name); + return ERR_PTR(-EINVAL); + } state = state_new(alias); if (IS_ERR(state)) |