From patchwork Tue Jul 1 16:32:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 32913 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f197.google.com (mail-vc0-f197.google.com [209.85.220.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E3CDB20DCC for ; Tue, 1 Jul 2014 16:34:44 +0000 (UTC) Received: by mail-vc0-f197.google.com with SMTP id il7sf21611810vcb.8 for ; Tue, 01 Jul 2014 09:34:44 -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=jrHOaqjwK61Tbv54G0Tr9X9iQ7sWeG3iQcJHNbp795M=; b=DMELC8mEqdJOC/B5FZEwCYG13QJ7hQ9BJwJl6s59+NIAbmYMv2AGUL7CPHjg8+mjPn tHJBjL/YlYG+Tf6kp3LakgXZXZCfc2oehwJ1D12U03EG+waAO8yhw1SRZpza8LAxLRN6 QEczofAjLJmuKMdxNdq1o4iLJUdJzWh1axdv/hfSRIy9MmJZyVI8CHrm8od9Wa0lXg7A M/PMO8XK2hy9txEYU4MK3kYgI/XWEQQk7n6e815vLB4q4XOAKhjBAlXyt0WeC2S5wlAX KUTFYS+Tt5UckeuJmQoLikvRxfFk54LfMTscBF7MgcvVTWIc48wm9vwCJbnlOel+vD1r u9JQ== X-Gm-Message-State: ALoCoQkJwoQxytk/hOCebSGlZPUZdrPYu8+GgPjICsATyaXxfdPAPZev+h1aQf4Ee4PBhB/QSLct X-Received: by 10.58.219.105 with SMTP id pn9mr26274166vec.30.1404232484560; Tue, 01 Jul 2014 09:34:44 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.100.235 with SMTP id s98ls1267533qge.79.gmail; Tue, 01 Jul 2014 09:34:44 -0700 (PDT) X-Received: by 10.58.112.65 with SMTP id io1mr1548046veb.61.1404232484444; Tue, 01 Jul 2014 09:34:44 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id lt5si11624774vcb.103.2014.07.01.09.34.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 01 Jul 2014 09:34:44 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.180 as permitted sender) client-ip=209.85.128.180; Received: by mail-ve0-f180.google.com with SMTP id jw12so9892783veb.39 for ; Tue, 01 Jul 2014 09:34:44 -0700 (PDT) X-Received: by 10.53.7.204 with SMTP id de12mr1444145vdd.41.1404232484285; Tue, 01 Jul 2014 09:34:44 -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.37.5 with SMTP id tc5csp228351vcb; Tue, 1 Jul 2014 09:34:43 -0700 (PDT) X-Received: by 10.66.66.202 with SMTP id h10mr1849175pat.70.1404232483524; Tue, 01 Jul 2014 09:34:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xk1si27527903pab.68.2014.07.01.09.34.42; Tue, 01 Jul 2014 09:34:43 -0700 (PDT) Received-SPF: none (google.com: linux-pm-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 S1758467AbaGAQeh (ORCPT + 13 others); Tue, 1 Jul 2014 12:34:37 -0400 Received: from mail-pd0-f172.google.com ([209.85.192.172]:64731 "EHLO mail-pd0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758460AbaGAQef (ORCPT ); Tue, 1 Jul 2014 12:34:35 -0400 Received: by mail-pd0-f172.google.com with SMTP id w10so10401052pde.31 for ; Tue, 01 Jul 2014 09:34:35 -0700 (PDT) X-Received: by 10.68.222.196 with SMTP id qo4mr62849821pbc.14.1404232475134; Tue, 01 Jul 2014 09:34:35 -0700 (PDT) Received: from localhost ([122.166.172.22]) by mx.google.com with ESMTPSA id fv2sm33451184pbd.11.2014.07.01.09.34.28 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 01 Jul 2014 09:34:34 -0700 (PDT) From: Viresh Kumar To: rjw@rjwysocki.net, shawn.guo@linaro.org Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, arvind.chauhan@arm.com, sboyd@codeaurora.org, linux-arm-msm@vger.kernel.org, spk.linux@gmail.com, thomas.ab@samsung.com, nm@ti.com, t.figa@samsung.com, Viresh Kumar Subject: [PATCH 07/14] cpufreq: cpu0: OPPs can be populated at runtime Date: Tue, 1 Jul 2014 22:02:36 +0530 Message-Id: <1ba7771e910084cd0820c19ca5994fe1b3d6451d.1404231535.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.0.0.rc2 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@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.180 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: , OPPs can be populated statically, via DT, or added at run time with dev_pm_opp_add(). While this driver handles the first case correctly, it would fail to populate OPPs added at runtime. Because call to of_init_opp_table() would fail as there are no OPPs in DT and probe will return early. To fix this, remove error checking and call dev_pm_opp_init_cpufreq_table() unconditionally. Suggested-by: Stephen Boyd Signed-off-by: Viresh Kumar Acked-by: Santosh Shilimkar --- drivers/cpufreq/cpufreq-cpu0.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c index b5b8e1c..f47f703 100644 --- a/drivers/cpufreq/cpufreq-cpu0.c +++ b/drivers/cpufreq/cpufreq-cpu0.c @@ -164,11 +164,8 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev) goto out_put_reg; } - ret = of_init_opp_table(cpu_dev); - if (ret) { - pr_err("failed to init OPP table: %d\n", ret); - goto out_put_clk; - } + /* OPPs might be populated at runtime, don't check for error here */ + of_init_opp_table(cpu_dev); ret = dev_pm_opp_init_cpufreq_table(cpu_dev, &freq_table); if (ret) {