]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/of/base.c
Merge tag 'iio-fixes-for-3.16b' of git://git.kernel.org/pub/scm/linux/kernel/git...
[karo-tx-linux.git] / drivers / of / base.c
index 8368d96ae7b44d3ce7b74b37abe3eac6cac76191..b9864806e9b811a0c3cc3b0e16404a19fad271eb 100644 (file)
@@ -227,7 +227,8 @@ static int __of_node_add(struct device_node *np)
        np->kobj.kset = of_kset;
        if (!np->parent) {
                /* Nodes without parents are new top level trees */
-               rc = kobject_add(&np->kobj, NULL, safe_name(&of_kset->kobj, "base"));
+               rc = kobject_add(&np->kobj, NULL, "%s",
+                                safe_name(&of_kset->kobj, "base"));
        } else {
                name = safe_name(&np->parent->kobj, kbasename(np->full_name));
                if (!name || !name[0])
@@ -1960,9 +1961,9 @@ int of_attach_node(struct device_node *np)
 
        raw_spin_lock_irqsave(&devtree_lock, flags);
        np->sibling = np->parent->child;
-       np->allnext = of_allnodes;
+       np->allnext = np->parent->allnext;
+       np->parent->allnext = np;
        np->parent->child = np;
-       of_allnodes = np;
        of_node_clear_flag(np, OF_DETACHED);
        raw_spin_unlock_irqrestore(&devtree_lock, flags);