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:
parent
ef39770210
commit
7098d7121e
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue