diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-05-04 12:27:21 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-05-04 12:57:00 +0200 |
commit | 49831918036ab3292870dc2c6035292e6af47ae1 (patch) | |
tree | 3727edcdaa65dfccc6949d938c216b51957f3442 /common/state/state.c | |
parent | b30047b433a60e6183216e8364971efddd5d208e (diff) | |
download | barebox-49831918036ab3292870dc2c6035292e6af47ae1.tar.gz barebox-49831918036ab3292870dc2c6035292e6af47ae1.tar.xz |
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>
Diffstat (limited to 'common/state/state.c')
-rw-r--r-- | common/state/state.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/common/state/state.c b/common/state/state.c index c3c8b768c7..41bee0fdc5 100644 --- a/common/state/state.c +++ b/common/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)) |