Message ID | a3c1c90c6df3b23df528f40ef653c189dec25832.1400736536.git.viresh.kumar@linaro.org |
---|---|
State | New |
Headers | show
Return-Path: <patchwork-forward+bncBCRIZROPVQPBBUE262NQKGQEXR3DISY@linaro.org> X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 0E91D20675 for <linaro@patches.linaro.org>; Thu, 22 May 2014 05:38:25 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id db11sf10595368veb.0 for <linaro@patches.linaro.org>; Wed, 21 May 2014 22:38:24 -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=hEYTt/h6to/t3anGcUIPxuxoA3Mqwe1OmWQb9pH/GMzKFaHK2ioBAlc7boxSzOgbJH DNpBlFZe5vhFvfEzI9+ggtAPaHEq4hh+CwH9an2JUDYecQY5btnCNU5H5wPzVdqSH9er BVXrbgDzwcXgXDmqRsU1ZKGgaDxGO8gUjQ5l51dkxGNwfRHkT7XhVxLbwjybxU6eUUUt ZyF33gANQXNDI6MxJbBANMXBLncmmUjkMGcqz6BMvwSDewh020jOVzuUsEI+uLXsjZ+Q DLV066eM7NUCUmjO+z8R2yw6OytcS8uOswCT32icjnNXvQuDo3jsZ/HyhNWzqHzZEuqP QNkg== X-Gm-Message-State: ALoCoQk2ry/Fs8z3mp2FIcTroXhKhkbmL94zOd9PbY9xgMUPkHZMtwzUIYeH3b5xfXRocbAq3gsa X-Received: by 10.58.165.33 with SMTP id yv1mr6691898veb.30.1400737104859; Wed, 21 May 2014 22:38:24 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.145 with SMTP id g17ls1075946qge.76.gmail; Wed, 21 May 2014 22:38:24 -0700 (PDT) X-Received: by 10.221.5.1 with SMTP id oe1mr7327843vcb.10.1400737104753; Wed, 21 May 2014 22:38:24 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id dn9si2573672vdc.46.2014.05.21.22.38.24 for <patchwork-forward@linaro.org> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 May 2014 22:38:24 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.176 as permitted sender) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id jz11so3749218veb.21 for <patchwork-forward@linaro.org>; Wed, 21 May 2014 22:38:24 -0700 (PDT) X-Received: by 10.52.14.130 with SMTP id p2mr11857541vdc.39.1400737104673; Wed, 21 May 2014 22:38: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.220.221.72 with SMTP id ib8csp169750vcb; Wed, 21 May 2014 22:38:24 -0700 (PDT) X-Received: by 10.68.194.134 with SMTP id hw6mr64409541pbc.49.1400737103941; Wed, 21 May 2014 22:38:23 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yk5si19897324pac.50.2014.05.21.22.38.23; Wed, 21 May 2014 22:38: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 S1753610AbaEVFiK (ORCPT <rfc822;sandeep.tripathy@linaro.org> + 27 others); Thu, 22 May 2014 01:38:10 -0400 Received: from mail-qc0-f179.google.com ([209.85.216.179]:55192 "EHLO mail-qc0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753457AbaEVFiG (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 22 May 2014 01:38:06 -0400 Received: by mail-qc0-f179.google.com with SMTP id x3so4904225qcv.10 for <linux-kernel@vger.kernel.org>; Wed, 21 May 2014 22:38:05 -0700 (PDT) X-Received: by 10.224.50.205 with SMTP id a13mr64655534qag.19.1400737085682; Wed, 21 May 2014 22:38:05 -0700 (PDT) Received: from localhost (ec2-23-23-178-99.compute-1.amazonaws.com. [23.23.178.99]) by mx.google.com with ESMTPSA id p95sm2106001qgd.23.2014.05.21.22.38.00 for <multiple recipients> (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 21 May 2014 22:38:05 -0700 (PDT) From: Viresh Kumar <viresh.kumar@linaro.org> 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 <viresh.kumar@linaro.org> Subject: [PATCH V3 3/8] opp: call of_node_{get|put}() from of_init_opp_table() Date: Thu, 22 May 2014 11:07:27 +0530 Message-Id: <a3c1c90c6df3b23df528f40ef653c189dec25832.1400736536.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: <cover.1400736536.git.viresh.kumar@linaro.org> References: <cover.1400736536.git.viresh.kumar@linaro.org> In-Reply-To: <cover.1400736536.git.viresh.kumar@linaro.org> References: <cover.1400736536.git.viresh.kumar@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: <patchwork-forward.linaro.org> 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.128.176 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: <http://groups.google.com/a/linaro.org/group/patchwork-forward/post>, <mailto:patchwork-forward@linaro.org> List-Help: <http://support.google.com/a/linaro.org/bin/topic.py?topic=25838>, <mailto:patchwork-forward+help@linaro.org> List-Archive: <http://groups.google.com/a/linaro.org/group/patchwork-forward/> List-Unsubscribe: <http://groups.google.com/a/linaro.org/group/patchwork-forward/subscribe>, <mailto:googlegroups-manage+836684582541+unsubscribe@googlegroups.com> |
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);
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 <viresh.kumar@linaro.org> --- drivers/base/power/opp.c | 4 ++++ 1 file changed, 4 insertions(+)