[RFC 2/8] drivers/of: attach top level tree nodes to sysfs with their name

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Nodes without parents are new top level trees. If we want to attach
more than one tree, we need a different name for each top node.

Signed-off-by: Franck Jullien <franck.jullien@xxxxxxxxxxxxxxxxxxx>
---
 drivers/of/base.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 017dd94..a7ff11f 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -172,7 +172,7 @@ int __of_attach_node_sysfs(struct device_node *np)
 	if (!np->parent) {
 		/* Nodes without parents are new top level trees */
 		rc = kobject_add(&np->kobj, NULL, "%s",
-				 safe_name(&of_kset->kobj, "base"));
+				 safe_name(&of_kset->kobj, np == of_root ? "base" : np->name));
 	} else {
 		name = safe_name(&np->parent->kobj, kbasename(np->full_name));
 		if (!name || !name[0])
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux