From patchwork Wed Sep 10 03:50:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guodong Xu X-Patchwork-Id: 37178 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f71.google.com (mail-pa0-f71.google.com [209.85.220.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C813520491 for ; Wed, 10 Sep 2014 03:51:25 +0000 (UTC) Received: by mail-pa0-f71.google.com with SMTP id rd3sf31057549pab.6 for ; Tue, 09 Sep 2014 20:51:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=ERY4cVzXZk+hPoDtUZ0pC7JJJlaUR3oJ2jFt2JextnU=; b=Qv4y746TzCPPddL84+FvmDt6DvJGEKXoXXb4QirEOE1LjzTkqIQkN8S5VV/Ax1gWyw ZrlvmYoV+tjm+Rlr9JEA0uOFZr58JcyoUisUDOdi3DglvcVxukODbuEai1+mw5KumEnx jteuN1XqbF+iwbhg/5wNBJuRH2BvrOMv0nqkNanKacBpGnLX0mLlrqXzd/QgoLPZz/Zn vCt02E5c6BqfSXZRIsxK//t0WeNm4m+zvThOCGf8AV3va7Cs1Tg3n52xXTcov1BCYgIK Oh748n6EiOnCxHAAyehOhI+gnD4yiODj4l1YvLFJYB7OmevY79VpYBTCcCNI0hcf7xav ajGw== X-Gm-Message-State: ALoCoQlo65a1wN/tyUfbACNK6tzm5QfYz/W+PYI/NiQl1rLp7Zjp767IE3gq2vS+lO4Q4CaphrIo X-Received: by 10.66.245.197 with SMTP id xq5mr10858356pac.42.1410321084925; Tue, 09 Sep 2014 20:51:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.47.87 with SMTP id l81ls1607505qga.51.gmail; Tue, 09 Sep 2014 20:51:24 -0700 (PDT) X-Received: by 10.220.194.71 with SMTP id dx7mr573195vcb.64.1410321084798; Tue, 09 Sep 2014 20:51:24 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id t6si6611000vdf.14.2014.09.09.20.51.24 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Sep 2014 20:51:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id hy4so3385511vcb.9 for ; Tue, 09 Sep 2014 20:51:24 -0700 (PDT) X-Received: by 10.52.137.2 with SMTP id qe2mr28275447vdb.11.1410321084693; Tue, 09 Sep 2014 20:51:24 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp378216vcb; Tue, 9 Sep 2014 20:51:24 -0700 (PDT) X-Received: by 10.70.126.99 with SMTP id mx3mr50573392pdb.52.1410321083724; Tue, 09 Sep 2014 20:51:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o16si25932748pdj.105.2014.09.09.20.51.22 for ; Tue, 09 Sep 2014 20:51:23 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750937AbaIJDvO (ORCPT + 27 others); Tue, 9 Sep 2014 23:51:14 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:57384 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750719AbaIJDvM (ORCPT ); Tue, 9 Sep 2014 23:51:12 -0400 Received: by mail-pa0-f43.google.com with SMTP id fa1so6159780pad.2 for ; Tue, 09 Sep 2014 20:51:12 -0700 (PDT) X-Received: by 10.68.68.134 with SMTP id w6mr33676807pbt.110.1410321072244; Tue, 09 Sep 2014 20:51:12 -0700 (PDT) Received: from localhost.localdomain ([119.9.85.22]) by mx.google.com with ESMTPSA id fk5sm12964995pbb.13.2014.09.09.20.51.09 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Sep 2014 20:51:11 -0700 (PDT) From: Guodong Xu To: broonie@kernel.org, axel.lin@ingics.com, lgirdwood@gmail.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, support.opensource@diasemi.com Cc: Guodong Xu Subject: [PATCH] regulator: remove unnecessary of_node_get() to parent Date: Wed, 10 Sep 2014 11:50:39 +0800 Message-Id: <1410321039-26888-1-git-send-email-guodong.xu@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: guodong.xu@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , These of_node_get() were added to balance refcount decrements inside of of_find_node_by_name(). See: commit c92f5dd2c42f ("regulator: Add missing of_node_put()") However of_find_node_by_name() was then replaced by of_get_child_by_name(), which doesn't call of_node_put() against its input parameter. So, need to remove these unnecessary of_node_get() calls. Signed-off-by: Guodong Xu Reviewed-by: Axel Lin --- drivers/regulator/88pm8607.c | 2 +- drivers/regulator/da9052-regulator.c | 4 ++-- drivers/regulator/max8907-regulator.c | 2 +- drivers/regulator/max8925-regulator.c | 2 +- drivers/regulator/max8997.c | 2 +- drivers/regulator/palmas-regulator.c | 1 - drivers/regulator/tps65910-regulator.c | 2 +- 7 files changed, 7 insertions(+), 8 deletions(-) diff --git a/drivers/regulator/88pm8607.c b/drivers/regulator/88pm8607.c index 337634a..6d77dcd 100644 --- a/drivers/regulator/88pm8607.c +++ b/drivers/regulator/88pm8607.c @@ -319,7 +319,7 @@ static int pm8607_regulator_dt_init(struct platform_device *pdev, struct regulator_config *config) { struct device_node *nproot, *np; - nproot = of_node_get(pdev->dev.parent->of_node); + nproot = pdev->dev.parent->of_node; if (!nproot) return -ENODEV; nproot = of_get_child_by_name(nproot, "regulators"); diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c index fdb6ea8..0003362 100644 --- a/drivers/regulator/da9052-regulator.c +++ b/drivers/regulator/da9052-regulator.c @@ -422,9 +422,9 @@ static int da9052_regulator_probe(struct platform_device *pdev) config.init_data = pdata->regulators[pdev->id]; } else { #ifdef CONFIG_OF - struct device_node *nproot, *np; + struct device_node *nproot = da9052->dev->of_node; + struct device_node *np; - nproot = of_node_get(da9052->dev->of_node); if (!nproot) return -ENODEV; diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c index 9623e9e..3426be8 100644 --- a/drivers/regulator/max8907-regulator.c +++ b/drivers/regulator/max8907-regulator.c @@ -226,7 +226,7 @@ static int max8907_regulator_parse_dt(struct platform_device *pdev) struct device_node *np, *regulators; int ret; - np = of_node_get(pdev->dev.parent->of_node); + np = pdev->dev.parent->of_node; if (!np) return 0; diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c index dad2bcd..7770777 100644 --- a/drivers/regulator/max8925-regulator.c +++ b/drivers/regulator/max8925-regulator.c @@ -250,7 +250,7 @@ static int max8925_regulator_dt_init(struct platform_device *pdev, struct device_node *nproot, *np; int rcount; - nproot = of_node_get(pdev->dev.parent->of_node); + nproot = pdev->dev.parent->of_node; if (!nproot) return -ENODEV; np = of_get_child_by_name(nproot, "regulators"); diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 90b4c53..9c31e21 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c @@ -917,7 +917,7 @@ static int max8997_pmic_dt_parse_pdata(struct platform_device *pdev, struct max8997_regulator_data *rdata; unsigned int i, dvs_voltage_nr = 1, ret; - pmic_np = of_node_get(iodev->dev->of_node); + pmic_np = iodev->dev->of_node; if (!pmic_np) { dev_err(&pdev->dev, "could not find pmic sub-node\n"); return -ENODEV; diff --git a/drivers/regulator/palmas-regulator.c b/drivers/regulator/palmas-regulator.c index a7ce34d..1878e5b 100644 --- a/drivers/regulator/palmas-regulator.c +++ b/drivers/regulator/palmas-regulator.c @@ -1427,7 +1427,6 @@ static void palmas_dt_to_pdata(struct device *dev, u32 prop; int idx, ret; - node = of_node_get(node); regulators = of_get_child_by_name(node, "regulators"); if (!regulators) { dev_info(dev, "regulator node not found\n"); diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c index 2064507..18fc991 100644 --- a/drivers/regulator/tps65910-regulator.c +++ b/drivers/regulator/tps65910-regulator.c @@ -1014,7 +1014,7 @@ static struct tps65910_board *tps65910_parse_dt_reg_data( if (!pmic_plat_data) return NULL; - np = of_node_get(pdev->dev.parent->of_node); + np = pdev->dev.parent->of_node; regulators = of_get_child_by_name(np, "regulators"); if (!regulators) { dev_err(&pdev->dev, "regulator node not found\n");