9
0
Fork 0

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>
This commit is contained in:
Marc Kleine-Budde 2015-10-25 22:03:31 +01:00 committed by Sascha Hauer
parent ef39770210
commit 7098d7121e
1 changed files with 1 additions and 1 deletions

View File

@ -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))