From patchwork Fri Sep 13 12:59:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2890521 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 71D72BFF05 for ; Fri, 13 Sep 2013 16:05:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B0EBC20328 for ; Fri, 13 Sep 2013 16:05:26 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 35D0F20319 for ; Fri, 13 Sep 2013 16:05:25 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKT9G-0007Sf-Oy; Fri, 13 Sep 2013 13:10:59 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKT8w-0006N7-PP; Fri, 13 Sep 2013 13:10:38 +0000 Received: from mail-pd0-f177.google.com ([209.85.192.177]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1VKT5j-0005l8-Ua for linux-arm-kernel@lists.infradead.org; Fri, 13 Sep 2013 13:07:28 +0000 Received: by mail-pd0-f177.google.com with SMTP id y10so1217247pdj.8 for ; Fri, 13 Sep 2013 06:06:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=/EUjYJraCM46KxtMT58cf8H1YZMpjA7UojBqo2fEAE4=; b=EYfxZXbxamQSis3lFNs7M6GvRAYhpmfhVbd5VtLSSP+MH3I+ujglgnrmCuhKfY18MP W5eP6AmBn3s21buqslsSfdopLpmq/pDr8QNCgrawJgXM9eWrjcuMEiPYKomm4T284hlG +um2mmpcFo7PZruMPKJkbHY34Hkm3Ww1plOZrSeZpQLbAocTLs00kc+IMz7Az67vBEkP J180PiayeEGNk6bkSPqKauOY+zWnhNMyW66bwkZBlyLQuOxO1iYd1SxSWU8sjh39NZWF HG43SMrphC7ssRc9VvdrIjJK7DcMvqu8E6bmCrWhiT7XhqSSjSuE5sakicC41eIPwOjV M4xg== X-Gm-Message-State: ALoCoQkP9+bzl2FuiSIGuroEe2O0OKgB6svLfAFOj+EajbzB1gIu5tDOSV9JNZ0Zs1FbPm0UN3cL X-Received: by 10.66.249.231 with SMTP id yx7mr15394620pac.116.1379077618551; Fri, 13 Sep 2013 06:06:58 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id oj6sm17999360pab.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:06:58 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH 033/228] cpufreq: powernow: use cpufreq_table_validate_and_show() Date: Fri, 13 Sep 2013 18:29:39 +0530 Message-Id: <12636ab6db630cb8306181a0b8d3bb14c9af6039.1379063063.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130913_090720_127527_EDABD861 X-CRM114-Status: GOOD ( 11.59 ) X-Spam-Score: -1.9 (-) Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Lets use cpufreq_table_validate_and_show() instead of calling cpufreq_frequency_table_cpuinfo() and cpufreq_frequency_table_get_attr(). Signed-off-by: Viresh Kumar --- drivers/cpufreq/powernow-k6.c | 9 +-------- drivers/cpufreq/powernow-k7.c | 4 +--- drivers/cpufreq/powernow-k8.c | 4 +--- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/drivers/cpufreq/powernow-k6.c b/drivers/cpufreq/powernow-k6.c index 85f1c8c..ab1de0d 100644 --- a/drivers/cpufreq/powernow-k6.c +++ b/drivers/cpufreq/powernow-k6.c @@ -145,7 +145,6 @@ static int powernow_k6_target(struct cpufreq_policy *policy, static int powernow_k6_cpu_init(struct cpufreq_policy *policy) { unsigned int i, f; - int result; if (policy->cpu != 0) return -ENODEV; @@ -167,13 +166,7 @@ static int powernow_k6_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = 200000; policy->cur = busfreq * max_multiplier; - result = cpufreq_frequency_table_cpuinfo(policy, clock_ratio); - if (result) - return result; - - cpufreq_frequency_table_get_attr(clock_ratio, policy->cpu); - - return 0; + return cpufreq_table_validate_and_show(policy, clock_ratio); } diff --git a/drivers/cpufreq/powernow-k7.c b/drivers/cpufreq/powernow-k7.c index 14ce480..c863c13 100644 --- a/drivers/cpufreq/powernow-k7.c +++ b/drivers/cpufreq/powernow-k7.c @@ -680,9 +680,7 @@ static int powernow_cpu_init(struct cpufreq_policy *policy) policy->cur = powernow_get(0); - cpufreq_frequency_table_get_attr(powernow_table, policy->cpu); - - return cpufreq_frequency_table_cpuinfo(policy, powernow_table); + return cpufreq_table_validate_and_show(policy, powernow_table); } static int powernow_cpu_exit(struct cpufreq_policy *policy) diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c index 8215bbc..8bd8cdb 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -1176,7 +1176,7 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) pr_debug("policy current frequency %d kHz\n", pol->cur); /* min/max the cpu is capable of */ - if (cpufreq_frequency_table_cpuinfo(pol, data->powernow_table)) { + if (cpufreq_table_validate_and_show(pol, data->powernow_table)) { printk(KERN_ERR FW_BUG PFX "invalid powernow_table\n"); powernow_k8_cpu_exit_acpi(data); kfree(data->powernow_table); @@ -1184,8 +1184,6 @@ static int powernowk8_cpu_init(struct cpufreq_policy *pol) return -EINVAL; } - cpufreq_frequency_table_get_attr(data->powernow_table, pol->cpu); - pr_debug("cpu_init done, current fid 0x%x, vid 0x%x\n", data->currfid, data->currvid);