From 7098d7121e98a8a9bcda726c1a35ac2d0f29de65 Mon Sep 17 00:00:00 2001 From: Marc Kleine-Budde Date: Sun, 25 Oct 2015 22:03:31 +0100 Subject: 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 Signed-off-by: Sascha Hauer --- drivers/misc/state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/misc') 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)) -- cgit v1.2.3