powerpc: pseries: remove dlpar_attach_node dependency on full path
authorRob Herring <robh@kernel.org>
Mon, 21 Aug 2017 15:16:49 +0000 (10:16 -0500)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 23 Aug 2017 12:27:04 +0000 (22:27 +1000)
In preparation to stop storing the full node path in full_name, remove the
dependency on full_name from dlpar_attach_node(). Callers of
dlpar_attach_node() already have the parent device_node, so just pass the
parent node into dlpar_attach_node instead of the path. This avoids doing
a lookup of the parent node by the path.

Signed-off-by: Rob Herring <robh@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: linuxppc-dev@lists.ozlabs.org
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/pseries/dlpar.c
arch/powerpc/platforms/pseries/hotplug-cpu.c
arch/powerpc/platforms/pseries/mobility.c
arch/powerpc/platforms/pseries/pseries.h

index 80b84c9c85094762b8d138db7482d1070c682657..783f3636469093034ae26a23856fef6aaf1922a6 100644 (file)
@@ -254,13 +254,11 @@ cc_error:
        return first_dn;
 }
 
-int dlpar_attach_node(struct device_node *dn)
+int dlpar_attach_node(struct device_node *dn, struct device_node *parent)
 {
        int rc;
 
-       dn->parent = pseries_of_derive_parent(dn->full_name);
-       if (IS_ERR(dn->parent))
-               return PTR_ERR(dn->parent);
+       dn->parent = parent;
 
        rc = of_attach_node(dn);
        if (rc) {
index 0a93093fbcef4888c4d9b520570d4433e818b501..b357f1ae0b0a0e4a0fd295a75f00a0e3e8be2160 100644 (file)
@@ -463,7 +463,7 @@ static ssize_t dlpar_cpu_add(u32 drc_index)
                return -EINVAL;
        }
 
-       rc = dlpar_attach_node(dn);
+       rc = dlpar_attach_node(dn, parent);
        if (rc) {
                saved_rc = rc;
                pr_warn("Failed to attach node %s, rc: %d, drc index: %x\n",
index 2da4851eff994717ef218d68831a78138604136a..210ce632d63e1e47c2796acd767e3bf610da7439 100644 (file)
@@ -229,7 +229,7 @@ static int add_dt_node(__be32 parent_phandle, __be32 drc_index)
        if (!dn)
                return -ENOENT;
 
-       rc = dlpar_attach_node(dn);
+       rc = dlpar_attach_node(dn, parent_dn);
        if (rc)
                dlpar_free_cc_nodes(dn);
 
index 1361a9db534b76bfdd21cd058e828aaa8ae04dee..4470a3194311e06e040c624b8b1491eb0e071298 100644 (file)
@@ -46,7 +46,7 @@ extern void dlpar_free_cc_nodes(struct device_node *);
 extern void dlpar_free_cc_property(struct property *);
 extern struct device_node *dlpar_configure_connector(__be32,
                                                struct device_node *);
-extern int dlpar_attach_node(struct device_node *);
+extern int dlpar_attach_node(struct device_node *, struct device_node *);
 extern int dlpar_detach_node(struct device_node *);
 extern int dlpar_acquire_drc(u32 drc_index);
 extern int dlpar_release_drc(u32 drc_index);