From patchwork Wed May 21 11:10:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 30523 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1522820671 for ; Wed, 21 May 2014 11:10:46 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id lc6sf5919253vcb.3 for ; Wed, 21 May 2014 04:10:45 -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=TEFUWP3C/GqMD5eu1yuXmTPVDUFzS5seC44QueMRsqA=; b=A2XqBU4aCUiZkByBZFm+wju8Bzz3BDyNaOg9fOUAeaAu+AFi+vwZSW4OjK+IotC7WA /fS0oS4/vluj+lZrXFY1p87xcHSI4oOIGN1EftwDMG2RCAOYkb9VWpyJ481E0ftItE/c VCLz5J5AA1FhhKxwO+MqROT3+c55pC4T5DLB2+ztdcXroxHdQaoIbYpuuzSI9b1CAw2p XB7R/dskVkR/7c0VQYuqOddzq2Z5h311r2caFYUJsWg7bWTFfR44V7CCbY4Wx7WaPnkP 4oIrwHbNmJeOkfxpojJgEvymJYX3Y4/rZMAtzx7ieVCnHKDEGlfjPnp0ma9fawO+tKgf GV+Q== X-Gm-Message-State: ALoCoQlLXM22xwL9N634v7zC60hxgXfQGF4y5pMjOkwBVrK7+5wq+rUFtw0riK/c3KOPa5cBT5o8 X-Received: by 10.236.85.131 with SMTP id u3mr18919443yhe.40.1400670645612; Wed, 21 May 2014 04:10:45 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.109.247 with SMTP id l110ls568639qgf.90.gmail; Wed, 21 May 2014 04:10:45 -0700 (PDT) X-Received: by 10.58.29.16 with SMTP id f16mr30268683veh.23.1400670645440; Wed, 21 May 2014 04:10:45 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id ui7si2678218vcb.92.2014.05.21.04.10.45 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 May 2014 04:10:45 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id pa12so2294945veb.32 for ; Wed, 21 May 2014 04:10:45 -0700 (PDT) X-Received: by 10.52.147.200 with SMTP id tm8mr32878vdb.54.1400670645364; Wed, 21 May 2014 04:10:45 -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 ib8csp103797vcb; Wed, 21 May 2014 04:10:44 -0700 (PDT) X-Received: by 10.68.106.130 with SMTP id gu2mr57496421pbb.59.1400670644661; Wed, 21 May 2014 04:10:44 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cc3si28693423pad.47.2014.05.21.04.10.44; Wed, 21 May 2014 04:10:44 -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 S1752275AbaEULKf (ORCPT + 27 others); Wed, 21 May 2014 07:10:35 -0400 Received: from mail-qc0-f177.google.com ([209.85.216.177]:60002 "EHLO mail-qc0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752087AbaEULKd (ORCPT ); Wed, 21 May 2014 07:10:33 -0400 Received: by mail-qc0-f177.google.com with SMTP id i17so2876486qcy.22 for ; Wed, 21 May 2014 04:10:32 -0700 (PDT) X-Received: by 10.140.44.34 with SMTP id f31mr64813747qga.73.1400670632171; Wed, 21 May 2014 04:10:32 -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 q5sm1426767qam.37.2014.05.21.04.10.27 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 21 May 2014 04:10:31 -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 V2 2/7] opp: handle of_node_{get|put}() inside of_init_opp_table() Date: Wed, 21 May 2014 16:40:00 +0530 Message-Id: <62e2dc5fd75e25ff85a6b09f35fbeb476e1c35db.1400670427.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.128.173 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 call of_node_{get|put}() before and after calling it. It would be better if this can be handled within of_init_opp_table(). Signed-off-by: Viresh Kumar --- 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);