From patchwork Tue Oct 10 10:48:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sudeep Holla X-Patchwork-Id: 115386 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp3599566qgn; Tue, 10 Oct 2017 03:48:58 -0700 (PDT) X-Google-Smtp-Source: AOwi7QDOBYf3RiDMXh2kGKweucW268N3Wa8BYLo6+1fYVGhV/O8gCnLagQMkUm6dU3UORdVDYqCc X-Received: by 10.98.8.217 with SMTP id 86mr12948323pfi.66.1507632538072; Tue, 10 Oct 2017 03:48:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507632538; cv=none; d=google.com; s=arc-20160816; b=hb9MTnJ7087tFp+rVFt1kIjE2DV/KG4AGjYjixGf5xcP6bxoZZYipENP5YFXr7jV49 I4nULVif03l86ZRl2W09oCcosRbssnKPuHZ7TmrjHNGuffs4FwepbRY8WzQT5+hn0l6n 8JyiL759iXBSqEK5p3Eukm2seBEn3Yb3CJsIxBL3Bj7BKYRqL0lMdpEWmYR08TQH58F2 KDADXSrNIhlxe/r9XZK5FB6pKZgctvOi9CgWt/LQ6QMnCMCk65yDJCvqFkCDg//PSIVP PuP/thNtXFGGOnJUeXjWAbPXUfKYwLSIAqUwpvvSkK3oJnKO1BvtkBTQK5bag2QM9S+V TFlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=BpBTjh7do9xMjsFnTySwl/D3MuaAw9r9j13506yTfxk=; b=HzMWwz4aWcKaf49BTZuKY7bYSmXniDqW65HbMxafdEmKQQxM3LWk4h7FaRWi9abWTF swY/NDeg1XGG7HN5xys00ryV/cA9elYn2Ba5cN9eWMXXfjFfIWQpJ31LE0lR2aODybxB vHmFko2w2ACP83qg3DdN8/Kgsj0uknBTrKJuI4z3oHXZWcoyjXw/7OBn5JTZ7DizJ8VF wQvt/dvI9kN3z/DAjDinFsZMCdPYfwAXXw+3dMlgN4q2aRxHuTuCgqOXd6B/3fQyosT9 qLlKIASKq22DjKlyRRVDl2MOLXIUMXWe6Vdxm34zm4jLrv3LGFonzvdNzClfuRTX9q87 gkRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 a7si6690527pln.373.2017.10.10.03.48.57; Tue, 10 Oct 2017 03:48:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755760AbdJJKs4 (ORCPT + 12 others); Tue, 10 Oct 2017 06:48:56 -0400 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:42454 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755709AbdJJKsz (ORCPT ); Tue, 10 Oct 2017 06:48:55 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id ADB2380D; Tue, 10 Oct 2017 03:48:53 -0700 (PDT) Received: from e107155-lin.cambridge.arm.com (e107155-lin.cambridge.arm.com [10.1.211.34]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 571D63F58C; Tue, 10 Oct 2017 03:48:52 -0700 (PDT) From: Sudeep Holla To: linux-pm@vger.kernel.org, Viresh Kumar Cc: Sudeep Holla , Viresh Kumar , Nishanth Menon , Stephen Boyd , "Rafael J. Wysocki" Subject: [PATCH] PM / OPP: use of_cpu_device_node_get() instead of of_get_cpu_node() Date: Tue, 10 Oct 2017 11:48:39 +0100 Message-Id: <1507632519-19648-1-git-send-email-sudeep.holla@arm.com> X-Mailer: git-send-email 2.7.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Commit 762792913f8c ("PM / OPP: Fix get sharing CPUs when hotplug is used") moved away from using cpu_dev->of_node because of some limitations. However commit 7467c9d95989 ("of: return of_get_cpu_node from of_cpu_device_node_get if CPUs are not registered") added support to falls back to of_get_cpu_node if called if CPUs are not registered yet. This patch moves back to use of_cpu_device_node_get in dev_pm_opp_of_get_sharing_cpus to avoid scanning the device tree again. It also adds the missing of_node_put for the CPU device nodes. Cc: Viresh Kumar Cc: Nishanth Menon Cc: Stephen Boyd Cc: "Rafael J. Wysocki" Fixes: 762792913f8c ("PM / OPP: Fix get sharing CPUs when hotplug is used") Signed-off-by: Sudeep Holla --- drivers/base/power/opp/of.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/base/power/opp/of.c b/drivers/base/power/opp/of.c index 0b718886479b..3505193043fe 100644 --- a/drivers/base/power/opp/of.c +++ b/drivers/base/power/opp/of.c @@ -603,13 +603,14 @@ int dev_pm_opp_of_get_sharing_cpus(struct device *cpu_dev, if (cpu == cpu_dev->id) continue; - cpu_np = of_get_cpu_node(cpu, NULL); + cpu_np = of_cpu_device_node_get(cpu); if (!cpu_np) { dev_err(cpu_dev, "%s: failed to get cpu%d node\n", __func__, cpu); ret = -ENOENT; goto put_cpu_node; } + of_node_put(cpu_np); /* Get OPP descriptor node */ tmp_np = _opp_of_get_opp_desc_node(cpu_np);