Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1716590

[PATCH v2 3/5] powerpc: pseries: remove dlpar_attach_node dependency on full path

From Rob Herring <robh@kernel.org>
Newsgroups linux.kernel
Subject [PATCH v2 3/5] powerpc: pseries: remove dlpar_attach_node dependency on full path
Date 2017-08-21 17:20 +0200
Message-ID <ugWEG-60L-23@gated-at.bofh.it> (permalink)
References <ugWEF-60L-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
---
v2:
- rebased to linux-next

 arch/powerpc/platforms/pseries/dlpar.c       | 6 ++----
 arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 +-
 arch/powerpc/platforms/pseries/mobility.c    | 2 +-
 arch/powerpc/platforms/pseries/pseries.h     | 2 +-
 4 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c
index 80b84c9c8509..783f36364690 100644
--- a/arch/powerpc/platforms/pseries/dlpar.c
+++ b/arch/powerpc/platforms/pseries/dlpar.c
@@ -254,13 +254,11 @@ struct device_node *dlpar_configure_connector(__be32 drc_index,
 	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) {
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c
index 0a93093fbcef..b357f1ae0b0a 100644
--- a/arch/powerpc/platforms/pseries/hotplug-cpu.c
+++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c
@@ -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",
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 2da4851eff99..210ce632d63e 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -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);
 
diff --git a/arch/powerpc/platforms/pseries/pseries.h b/arch/powerpc/platforms/pseries/pseries.h
index 1361a9db534b..4470a3194311 100644
--- a/arch/powerpc/platforms/pseries/pseries.h
+++ b/arch/powerpc/platforms/pseries/pseries.h
@@ -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);
-- 
2.11.0

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/5] Removing full paths from DT full_name Rob Herring <robh@kernel.org> - 2017-08-21 17:20 +0200
  [PATCH v2 5/5] of/fdt: only store the device node basename in full_name Rob Herring <robh@kernel.org> - 2017-08-21 17:20 +0200
  [PATCH v2 2/5] powerpc: pseries: vio: match parent nodes with of_find_node_by_path Rob Herring <robh@kernel.org> - 2017-08-21 17:20 +0200
    Re: [PATCH v2 2/5] powerpc: pseries: vio: match parent nodes with of_find_node_by_path Michael Ellerman <mpe@ellerman.id.au> - 2017-08-22 07:20 +0200
      Re: [PATCH v2 2/5] powerpc: pseries: vio: match parent nodes with of_find_node_by_path Rob Herring <robh@kernel.org> - 2017-08-24 20:10 +0200
        Re: [PATCH v2 2/5] powerpc: pseries: vio: match parent nodes with of_find_node_by_path Michael Ellerman <mpe@ellerman.id.au> - 2017-08-25 02:20 +0200
  [PATCH v2 3/5] powerpc: pseries: remove dlpar_attach_node dependency on full path Rob Herring <robh@kernel.org> - 2017-08-21 17:20 +0200
    Re: [v2, 3/5] powerpc: pseries: remove dlpar_attach_node dependency on full path Michael Ellerman <patch-notifications@ellerman.id.au> - 2017-08-24 14:40 +0200
  [PATCH v2 4/5] powerpc: pseries: only store the device node basename in full_name Rob Herring <robh@kernel.org> - 2017-08-21 17:20 +0200

csiph-web