From patchwork Mon Apr 27 12:43:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 6280031 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3388FBF4A6 for ; Mon, 27 Apr 2015 12:46:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5FC5C203B7 for ; Mon, 27 Apr 2015 12:46:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 74710203DB for ; Mon, 27 Apr 2015 12:46:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964834AbbD0Mpv (ORCPT ); Mon, 27 Apr 2015 08:45:51 -0400 Received: from xavier.telenet-ops.be ([195.130.132.52]:58192 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932668AbbD0Mnx (ORCPT ); Mon, 27 Apr 2015 08:43:53 -0400 Received: from ayla.of.borg ([84.193.93.87]) by xavier.telenet-ops.be with bizsmtp id M0jr1q00N1t5w8s010jrxA; Mon, 27 Apr 2015 14:43:51 +0200 Received: from ramsan.of.borg ([192.168.97.29] helo=ramsan) by ayla.of.borg with esmtp (Exim 4.82) (envelope-from ) id 1YmiO7-00006q-Bd; Mon, 27 Apr 2015 14:43:51 +0200 Received: from geert by ramsan with local (Exim 4.82) (envelope-from ) id 1YmiO8-0003fU-2A; Mon, 27 Apr 2015 14:43:52 +0200 From: Geert Uytterhoeven To: "Rafael J. Wysocki" , Kevin Hilman , Ulf Hansson , Axel Haslam Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH/RFC v6 5/7] PM / Domains: Add helper variable np = dev->of_node Date: Mon, 27 Apr 2015 14:43:40 +0200 Message-Id: <1430138622-14029-6-git-send-email-geert+renesas@glider.be> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430138622-14029-1-git-send-email-geert+renesas@glider.be> References: <1430138622-14029-1-git-send-email-geert+renesas@glider.be> Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Just a cleanup, no functional changes. Signed-off-by: Geert Uytterhoeven Acked-by: Kevin Hilman Acked-by: Ulf Hansson --- v6: - Rebased on top of v4.1-rc1 for new RFC, v4: - Add more explanations, - Add Acked-by, v3: - No changes, v2: - New. --- drivers/base/power/domain.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index d1531602ae64528d..d20caa2c92b57edf 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2190,17 +2190,18 @@ static void genpd_dev_pm_sync(struct device *dev) */ int genpd_dev_pm_attach(struct device *dev) { + struct device_node *np = dev->of_node; struct of_phandle_args pd_args; struct generic_pm_domain *pd; int ret; - if (!dev->of_node) + if (!np) return -ENODEV; if (dev->pm_domain) return -EEXIST; - ret = of_parse_phandle_with_args(dev->of_node, "power-domains", + ret = of_parse_phandle_with_args(np, "power-domains", "#power-domain-cells", 0, &pd_args); if (ret < 0) { if (ret != -ENOENT) @@ -2211,8 +2212,7 @@ int genpd_dev_pm_attach(struct device *dev) * (for backwards compatibility of DT ABI) */ pd_args.args_count = 0; - pd_args.np = of_parse_phandle(dev->of_node, - "samsung,power-domain", 0); + pd_args.np = of_parse_phandle(np, "samsung,power-domain", 0); if (!pd_args.np) return -ENOENT; } @@ -2221,7 +2221,7 @@ int genpd_dev_pm_attach(struct device *dev) if (IS_ERR(pd)) { dev_dbg(dev, "%s() failed to find PM domain: %ld\n", __func__, PTR_ERR(pd)); - of_node_put(dev->of_node); + of_node_put(np); return PTR_ERR(pd); } @@ -2237,7 +2237,7 @@ int genpd_dev_pm_attach(struct device *dev) if (ret < 0) { dev_err(dev, "failed to add to PM domain %s: %d", pd->name, ret); - of_node_put(dev->of_node); + of_node_put(np); return ret; }