From patchwork Tue May 27 11:50:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 30961 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A8400203C3 for ; Tue, 27 May 2014 11:52:54 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id i57sf39171414yha.0 for ; Tue, 27 May 2014 04:52:54 -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:in-reply-to:references:in-reply-to:references :sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=eGqjjXZxzfzPla3s2CtfZjIAbCdDdNCpDdHV+XpBUV4=; b=WDNdj3aRNIll8czId0Ow4sWAV/51gcyMn1wHi26qXI+I4Uxos4UkTs1ooUSRQkmu5y Stg4cCjcE7cMVXswrdFqhSO0rQ4lmZOS2Qf6px4DOP2zknADby4RREqOB4WMMBNyumFW zJJvstbJPMjWjimVZkDbPU/g1xAwmsm04GbhTKA4/VNf/ZSuTP5MCQjin3i4iAZTayS3 5O0jvgd8UuzEOnQFooh5/BWJMGMOX8Se0ByTNe0RTPm1pfMvpnsTs8cDPvLdVrDxZOGe uvVTtUJOF1Sdd9nUHP5DG/6mVfrf2SrmgxXavJV5lUN62vw0C5RMzdzmLmNHPfNefy/9 us6w== X-Gm-Message-State: ALoCoQmEjbN9FdQkAmh/JeeBTTniSUHFT+0n88Z+o+4VhVGbHX+jkdnFQOQDIMj8d5dfiFKWKdVU X-Received: by 10.58.187.107 with SMTP id fr11mr13968382vec.34.1401191574463; Tue, 27 May 2014 04:52:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.51.132 with SMTP id u4ls3026355qga.36.gmail; Tue, 27 May 2014 04:52:54 -0700 (PDT) X-Received: by 10.220.167.2 with SMTP id o2mr26682081vcy.8.1401191574303; Tue, 27 May 2014 04:52:54 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id 5si7910098vdy.104.2014.05.27.04.52.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 27 May 2014 04:52:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so10543878vcb.1 for ; Tue, 27 May 2014 04:52:54 -0700 (PDT) X-Received: by 10.220.95.2 with SMTP id b2mr6563vcn.61.1401191574227; Tue, 27 May 2014 04:52:54 -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.220.221.72 with SMTP id ib8csp112572vcb; Tue, 27 May 2014 04:52:53 -0700 (PDT) X-Received: by 10.66.121.131 with SMTP id lk3mr35373568pab.61.1401191573460; Tue, 27 May 2014 04:52:53 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id my7si18360117pbc.191.2014.05.27.04.52.52 for ; Tue, 27 May 2014 04:52:52 -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 S1752257AbaE0Lwl (ORCPT + 27 others); Tue, 27 May 2014 07:52:41 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:65035 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752211AbaE0Lwg (ORCPT ); Tue, 27 May 2014 07:52:36 -0400 Received: by mail-pb0-f45.google.com with SMTP id um1so9141753pbc.18 for ; Tue, 27 May 2014 04:52:36 -0700 (PDT) X-Received: by 10.68.201.226 with SMTP id kd2mr35661970pbc.157.1401191556079; Tue, 27 May 2014 04:52:36 -0700 (PDT) Received: from localhost ([223.227.245.64]) by mx.google.com with ESMTPSA id x5sm23010571pbw.26.2014.05.27.04.52.30 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 27 May 2014 04:52:35 -0700 (PDT) From: Viresh Kumar To: rjw@rjwysocki.net Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, arvind.chauhan@arm.com, inderpal.s@samsung.com, nm@ti.com, chander.kashyap@linaro.org, pavel@ucw.cz, len.brown@intel.com, sudeep.holla@arm.com, Viresh Kumar Subject: [PATCH V4 2/8] opp: call of_node_{get|put}() from of_init_opp_table() Date: Tue, 27 May 2014 17:20:51 +0530 Message-Id: <4139797fe7501ba99adf63ec8e5cf9fa9b24c197.1401191054.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: References: In-Reply-To: References: 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: viresh.kumar@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.170 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: , All callers of of_init_opp_table() are required to take reference of dev->of_node, by initiating calls to of_node_{get|put}(), before and after calling of_init_opp_table(). Its better to call these from within of_init_opp_table(), no fun adding redundant code to every caller. Signed-off-by: Viresh Kumar Acked-by: Nishanth Menon --- drivers/base/power/opp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index faae9cf..2b615b9 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -622,6 +622,9 @@ int of_init_opp_table(struct device *dev) const __be32 *val; int nr; + if (!of_node_get(dev->of_node)) + return -ENODEV; + prop = of_find_property(dev->of_node, "operating-points", NULL); if (!prop) return -ENODEV; @@ -649,6 +652,7 @@ int of_init_opp_table(struct device *dev) nr -= 2; } + of_node_put(dev->of_node); return 0; } EXPORT_SYMBOL_GPL(of_init_opp_table);