[PATCH v2 4/8] state: use name of device node as name if alias is not available

Marc Kleine-Budde mkl at pengutronix.de
Tue Oct 20 01:39:08 PDT 2015


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 at pengutronix.de>
---
 drivers/misc/state.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/misc/state.c b/drivers/misc/state.c
index 4cda55b6efc6..e056b28f96c2 100644
--- a/drivers/misc/state.c
+++ b/drivers/misc/state.c
@@ -36,7 +36,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))
-- 
2.6.1




More information about the barebox mailing list