From patchwork Thu Aug 8 13:48:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2841291 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 62C68BF546 for ; Thu, 8 Aug 2013 15:26:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AE7C20519 for ; Thu, 8 Aug 2013 15:26: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 CE92720515 for ; Thu, 8 Aug 2013 15:26: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 1V7QhJ-0007R9-LR; Thu, 08 Aug 2013 13:56:14 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7Qgi-00050O-FQ; Thu, 08 Aug 2013 13:55:36 +0000 Received: from mail-pb0-f50.google.com ([209.85.160.50]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V7Qea-0004iB-2S for linux-arm-kernel@lists.infradead.org; Thu, 08 Aug 2013 13:53:25 +0000 Received: by mail-pb0-f50.google.com with SMTP id uo5so3269213pbc.9 for ; Thu, 08 Aug 2013 06:53:02 -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=3gXcDrORsRDopalh8pLWUoehNtGf9oyunGEik6fMQjk=; b=PAOZRKcEa2/muCoeoppkNIVtWxAQnoYi4g6chFbhGzqhpbu3FtA+jYw11yfyaELeW7 NHYiHhhFvRJKU2IgUsKAFRvfcQMuc4vFJ8T0qJUXMpkT7/51kL2wqGG5qqqZlZ9Qe9n4 Jmx3xuBUuVKnLaqCoxTCCUqNxIhj4NMs1L184+08KaMZ4SRpmJSbmvlTf24Vx8l1cLVT Hto0sSlTYxjCxfhIBu93es+hbmPx7c3Tw3jL6q7JHZkCo2g7DfSFoRBn2EdalepOIKmJ SjIq+CHhqlfcp0do/rLXRTswgfXa8jnKuhs/588AGimPpw/O201EJN5E36yR+XAP9v/0 g6GA== X-Gm-Message-State: ALoCoQk/x81uX0iBltdJWAa+HVW3TVJNlVOqkqifYOUoC4NWYkWb0zCaOPbBNm3MlDLVu5qqQ7Yb X-Received: by 10.66.216.129 with SMTP id oq1mr6336124pac.75.1375969982894; Thu, 08 Aug 2013 06:53:02 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id yk10sm16701879pac.16.2013.08.08.06.52.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 08 Aug 2013 06:53:02 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH 34/35] cpufreq: speedstep: use cpufreq_table_validate_and_show() Date: Thu, 8 Aug 2013 19:18:36 +0530 Message-Id: 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_095324_243399_19D405E0 X-CRM114-Status: GOOD ( 12.10 ) 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, "David S. Miller" , 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(). Cc: David S. Miller Signed-off-by: Viresh Kumar --- drivers/cpufreq/speedstep-centrino.c | 10 +--------- drivers/cpufreq/speedstep-ich.c | 9 +-------- drivers/cpufreq/speedstep-smi.c | 8 +------- 3 files changed, 3 insertions(+), 24 deletions(-) diff --git a/drivers/cpufreq/speedstep-centrino.c b/drivers/cpufreq/speedstep-centrino.c index f897d51..f180561 100644 --- a/drivers/cpufreq/speedstep-centrino.c +++ b/drivers/cpufreq/speedstep-centrino.c @@ -345,7 +345,6 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) struct cpuinfo_x86 *cpu = &cpu_data(policy->cpu); unsigned freq; unsigned l, h; - int ret; int i; /* Only Intel makes Enhanced Speedstep-capable CPUs */ @@ -402,15 +401,8 @@ static int centrino_cpu_init(struct cpufreq_policy *policy) pr_debug("centrino_cpu_init: cur=%dkHz\n", policy->cur); - ret = cpufreq_frequency_table_cpuinfo(policy, + return cpufreq_table_validate_and_show(policy, per_cpu(centrino_model, policy->cpu)->op_points); - if (ret) - return (ret); - - cpufreq_frequency_table_get_attr( - per_cpu(centrino_model, policy->cpu)->op_points, policy->cpu); - - return 0; } static int centrino_cpu_exit(struct cpufreq_policy *policy) diff --git a/drivers/cpufreq/speedstep-ich.c b/drivers/cpufreq/speedstep-ich.c index 5355abb..86a184e 100644 --- a/drivers/cpufreq/speedstep-ich.c +++ b/drivers/cpufreq/speedstep-ich.c @@ -320,7 +320,6 @@ static void get_freqs_on_cpu(void *_get_freqs) static int speedstep_cpu_init(struct cpufreq_policy *policy) { - int result; unsigned int policy_cpu, speed; struct get_freqs gf; @@ -349,13 +348,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) /* cpuinfo and default policy values */ policy->cur = speed; - result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs); - if (result) - return result; - - cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu); - - return 0; + return cpufreq_table_validate_and_show(policy, speedstep_freqs); } diff --git a/drivers/cpufreq/speedstep-smi.c b/drivers/cpufreq/speedstep-smi.c index abfba4f..f4d0318 100644 --- a/drivers/cpufreq/speedstep-smi.c +++ b/drivers/cpufreq/speedstep-smi.c @@ -329,13 +329,7 @@ static int speedstep_cpu_init(struct cpufreq_policy *policy) policy->cpuinfo.transition_latency = CPUFREQ_ETERNAL; policy->cur = speed; - result = cpufreq_frequency_table_cpuinfo(policy, speedstep_freqs); - if (result) - return result; - - cpufreq_frequency_table_get_attr(speedstep_freqs, policy->cpu); - - return 0; + return cpufreq_table_validate_and_show(policy, speedstep_freqs); } static int speedstep_cpu_exit(struct cpufreq_policy *policy)