summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2015-10-25 22:03:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-11-27 08:26:40 +0100
commit7098d7121e98a8a9bcda726c1a35ac2d0f29de65 (patch)
tree805c16fba10904321274a4ccbd2288b3a4c912fb
parentef39770210090086f019b636bc197fa189433c05 (diff)
downloadbarebox-7098d7121e98a8a9bcda726c1a35ac2d0f29de65.tar.gz
barebox-7098d7121e98a8a9bcda726c1a35ac2d0f29de65.tar.xz
state: use name of device node as name if alias is not available
Wihtout this patch, when using more than one state device an alias is mandatory, otherwise the there will be two state devices with the name state. This patch fixes the limitation by using the device node's name if no alias is defined. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/misc/state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/state.c b/drivers/misc/state.c
index 22551478e6..d46d5b941c 100644
--- a/drivers/misc/state.c
+++ b/drivers/misc/state.c
@@ -37,7 +37,7 @@ static int state_probe(struct device_d *dev)
alias = of_alias_get(np);
if (!alias)
- alias = "state";
+ alias = np->name;
state = state_new_from_node(alias, np);
if (IS_ERR(state))