From patchwork Thu Aug 8 13:48:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2841254 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 59D539F294 for ; Thu, 8 Aug 2013 14:33:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3F66620499 for ; Thu, 8 Aug 2013 14:33:28 +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 EA2DD20498 for ; Thu, 8 Aug 2013 14:33:26 +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 1V7Qg9-0006NJ-Q9; Thu, 08 Aug 2013 13:55:02 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7QfY-0004tI-V0; Thu, 08 Aug 2013 13:54:24 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7QdT-0004Y6-ST for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2013 13:52:17 +0000 Received: by mail-pa0-f46.google.com with SMTP id fa1so1570665pad.5 for ; Thu, 08 Aug 2013 06:51:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=fKQbvBSleC0K7P1WaaiV7fnC6bfGjeKAZL43K747LNE=; b=E3pFNQkJA/Po69cTmquPS2Bp1sSVqxEavzE89HEBaK0qtBSPekxREHZiWpKSjaskgp XMKbGFdXs8oxzbGtHxvO1+BybvRQPagCN35C0g7PhsUoxHvhSSbHHGzmLHJst+Q4qdWV nDz10syUEFY77kB+C1ootOC+BrHrssHiczzTZJDM3AcPQYydDTC1T7i4egd6wG2Llhb5 QwnZBiR/aW9XnWS0gXIPeQe1M8iXzkDyAOrosKfard3f4dhgmbnlKioPfTEKfkK/MW4N Hsj/EVybMydjjEJ72FF5ePzfv+l4NMJdVWw17RjgQEHY5QxmzgV6bwLqiSLvKD3LlmLO QMfA== X-Gm-Message-State: ALoCoQlaFoA0+1hma4aDF82cceEgI5rnfl5M9ezutMIZMqAPa0i7Bb1oovCd2Ubo68XZ9WQPVVsv X-Received: by 10.66.147.9 with SMTP id tg9mr6363123pab.5.1375969914545; Thu, 08 Aug 2013 06:51:54 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ys4sm14416453pbb.9.2013.08.08.06.51.50 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 08 Aug 2013 06:51:53 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH 25/35] cpufreq: powernow: use cpufreq_table_validate_and_show() Date: Thu, 8 Aug 2013 19:18:27 +0530 Message-Id: <8ddaa40a58ddff7b5e7e7b689f241136adbd422e.1375964117.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-20130808_095216_042133_183163FF X-CRM114-Status: GOOD ( 11.87 ) X-Spam-Score: -2.6 (--) 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=-4.2 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 2344a9e..8d4114a 100644 --- a/drivers/cpufreq/powernow-k8.c +++ b/drivers/cpufreq/powernow-k8.c @@ -1156,7 +1156,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); @@ -1164,8 +1164,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);