From: Rob Herring <robh@kernel.org>
To: devicetree@vger.kernel.org, Michael Ellerman <mpe@ellerman.id.au>,
linuxppc-dev@lists.ozlabs.org
Cc: linux-kernel@vger.kernel.org,
Frank Rowand <frowand.list@gmail.com>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
David Laight <David.Laight@aculab.com>
Subject: [PATCH v2 3/5] powerpc: pseries: remove dlpar_attach_node dependency on full path
Date: Mon, 21 Aug 2017 10:16:49 -0500 [thread overview]
Message-ID: <20170821151651.25096-4-robh@kernel.org> (raw)
In-Reply-To: <20170821151651.25096-1-robh@kernel.org>
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
next prev parent reply other threads:[~2017-08-21 15:17 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-21 15:16 [PATCH v2 0/5] Removing full paths from DT full_name Rob Herring
2017-08-21 15:16 ` Rob Herring
2017-08-21 15:16 ` [PATCH v2 1/5] powerpc: Convert to using %pOF instead of full_name Rob Herring
2017-08-24 12:37 ` [v2,1/5] " Michael Ellerman
2017-08-24 12:37 ` Michael Ellerman
2017-08-21 15:16 ` [PATCH v2 2/5] powerpc: pseries: vio: match parent nodes with of_find_node_by_path Rob Herring
2017-08-22 5:12 ` Michael Ellerman
2017-08-22 5:12 ` Michael Ellerman
2017-08-24 18:08 ` Rob Herring
2017-08-24 18:08 ` Rob Herring
2017-08-25 0:10 ` Michael Ellerman
2017-08-25 0:10 ` Michael Ellerman
2017-08-21 15:16 ` Rob Herring [this message]
2017-08-24 12:37 ` [v2, 3/5] powerpc: pseries: remove dlpar_attach_node dependency on full path Michael Ellerman
2017-08-21 15:16 ` [PATCH v2 4/5] powerpc: pseries: only store the device node basename in full_name Rob Herring
2017-10-03 9:26 ` Michael Ellerman
2017-10-03 9:26 ` Michael Ellerman
2017-10-03 18:44 ` Rob Herring
2017-10-04 12:37 ` Michael Ellerman
2017-10-04 12:37 ` Michael Ellerman
2017-08-21 15:16 ` [PATCH v2 5/5] of/fdt: " Rob Herring
2017-10-17 21:32 ` Alan Tull
2017-10-17 21:32 ` Alan Tull
2017-10-17 21:46 ` Rob Herring
2017-10-17 23:51 ` Frank Rowand
2017-10-17 23:51 ` Frank Rowand
2017-10-18 15:12 ` Alan Tull
2017-10-18 15:12 ` Alan Tull
2017-10-18 15:44 ` Rob Herring
2017-10-18 15:53 ` Pantelis Antoniou
2017-10-18 18:30 ` Rob Herring
2017-10-18 21:46 ` Frank Rowand
2017-10-19 8:41 ` Pantelis Antoniou
2017-10-19 8:41 ` Pantelis Antoniou
2017-10-19 8:41 ` Pantelis Antoniou
2017-10-19 8:51 ` Pantelis Antoniou
2017-10-19 8:51 ` Pantelis Antoniou
2017-10-19 8:51 ` Pantelis Antoniou
2017-10-19 20:06 ` Moritz Fischer
2017-10-19 21:46 ` Frank Rowand
2017-10-20 8:06 ` Pantelis Antoniou
2017-10-20 8:06 ` Pantelis Antoniou
2017-10-20 8:06 ` Pantelis Antoniou
2017-10-20 14:59 ` Rob Herring
2017-10-18 18:39 ` Alan Tull
2017-10-18 18:39 ` Alan Tull
2017-10-18 21:40 ` Frank Rowand
2017-10-18 21:40 ` Frank Rowand
2017-11-28 13:13 ` Geert Uytterhoeven
2017-11-28 13:13 ` Geert Uytterhoeven
2017-11-28 13:26 ` Rob Herring
2017-11-28 13:26 ` Rob Herring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170821151651.25096-4-robh@kernel.org \
--to=robh@kernel.org \
--cc=David.Laight@aculab.com \
--cc=benh@kernel.crashing.org \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.