diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2015-10-25 22:03:31 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-11-27 08:26:40 +0100 |
commit | 7098d7121e98a8a9bcda726c1a35ac2d0f29de65 (patch) | |
tree | 805c16fba10904321274a4ccbd2288b3a4c912fb | |
parent | ef39770210090086f019b636bc197fa189433c05 (diff) | |
download | barebox-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.c | 2 |
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)) |