From patchwork Mon Aug 21 15:16:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring \(Arm\)" X-Patchwork-Id: 110556 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp1430224qge; Mon, 21 Aug 2017 08:17:53 -0700 (PDT) X-Received: by 10.84.217.86 with SMTP id e22mr920101plj.22.1503328672943; Mon, 21 Aug 2017 08:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503328672; cv=none; d=google.com; s=arc-20160816; b=SRxrMwUHAG7J32Ic6J+x93ycsE7kMH7iOIM045X6ULVs1JKx2Pj2XjpPBVwyXj133l Z0rDu61OUphaWi1e1/EiiRpcEuhohDkJ0u3CBweDWs2kImkRPhNrFOwuzF0wug3Sa+ml kgCKsLyBS53w/nmAQimUH4xs684HK3UAiYlmVbKT0xQdkdMsKgWlYqsPGJ+hsh3oi874 LLttSPHC7RlVvAHBAMVElE2UZiYlhvW0PV4cLOiXpjV5IZA4iYCZzq74/GlCnoB16ZRM ZNgqMnQjfQdZlF86g8SC/RKnE4KSZl5Wi/1VnxCZJ4tINQssFKxj2R4wqKhp/rpK/jnO pOuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=pLRjG3Z0oOqSZ5EXVsaLQJ1EXeXiM9k8CJfjwWz59nw=; b=lT/LTu33n+q8GS4ZMPgMCSm35Iap0Aqw7uMTZ6OzKskcigQ/tZ/lC02/T9HEDdG7hl WzBwL3x4rOfQQwN5wuSCG1PQ9KuR+C6bn5T5oocn14fEFjN/Tc/4CCTRRQTw1VGJLgrb Jff8oU1TuJc5mHS5HoD4Bq8IOmFcy+/jNEHxHvxlzB9oImP2F3AuK+mXlFsgVDW3EXTO 8sWP3dt+T+HniYt851Se7MuUCt3x8rsXrW5vTHyMlWrnjJZbm2U8sX7wQkUi5eg6RjKp rT62IhTMm9od0qGHhAd1rWf+DRhv3styI/eeNRRDjRiQ8FeYhiQ4pItu4wWGLjwobdwr VNJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w31si4853529pla.693.2017.08.21.08.17.52; Mon, 21 Aug 2017 08:17:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754084AbdHUPRs (ORCPT + 26 others); Mon, 21 Aug 2017 11:17:48 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:37204 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753830AbdHUPRA (ORCPT ); Mon, 21 Aug 2017 11:17:00 -0400 Received: by mail-oi0-f68.google.com with SMTP id k77so2259697oib.4; Mon, 21 Aug 2017 08:17:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=pLRjG3Z0oOqSZ5EXVsaLQJ1EXeXiM9k8CJfjwWz59nw=; b=seD/ZOysHIhM3JV+AGqvT7XH/5LC5TdNDEodoDTV0tw61iJJMFr769kuz6orJYBE4s Zu/CWHxtGDvuyoz1Do6hqkCLTecwvs/hDqexcF5ikLCy0BdBz4/PsgJpn+f9jmsIJJPu nEU3PE9RFb9DjixSf6N+vdC0e1QYJrdn7b6FAukz23y5P2liJEsSKcapV6sfLrJXvBTV iRv//TQTGtT8EeCdbg4XNwEJ323eB6saSKcxuQr3K924GKfwblfAgOQLMoLjhQwqSgAv I/qW+D9uVmutQUdE16SripDXXLzkCsssIAcWCjL1tkzizQFwDJcSfwCt6JDPM9O5+hO7 r2Sg== X-Gm-Message-State: AHYfb5jcx1TyRTX8NBW8zPVUCYlvOVYv5oBJCJgiGxiZh2EWsHyjkyHT Ns+pL1JyQN9Bsrjfprs= X-Received: by 10.202.84.138 with SMTP id i132mr7405234oib.111.1503328619756; Mon, 21 Aug 2017 08:16:59 -0700 (PDT) Received: from localhost.localdomain (216-188-254-6.dyn.grandenetworks.net. [216.188.254.6]) by smtp.googlemail.com with ESMTPSA id q134sm4505638oic.51.2017.08.21.08.16.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Aug 2017 08:16:59 -0700 (PDT) From: Rob Herring To: devicetree@vger.kernel.org, Michael Ellerman , linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Frank Rowand , Benjamin Herrenschmidt , Paul Mackerras , David Laight Subject: [PATCH v2 3/5] powerpc: pseries: remove dlpar_attach_node dependency on full path Date: Mon, 21 Aug 2017 10:16:49 -0500 Message-Id: <20170821151651.25096-4-robh@kernel.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20170821151651.25096-1-robh@kernel.org> References: <20170821151651.25096-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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 Cc: Benjamin Herrenschmidt Cc: Paul Mackerras Cc: Michael Ellerman 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(-) -- 2.11.0 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);