From patchwork Fri Oct 18 13:59:41 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 3067571 Return-Path: X-Original-To: patchwork-linux-pm@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 CD8A2BF924 for ; Fri, 18 Oct 2013 14:07:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BBEF92039A for ; Fri, 18 Oct 2013 14:07:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8B29A2038E for ; Fri, 18 Oct 2013 14:07:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755688Ab3JROCd (ORCPT ); Fri, 18 Oct 2013 10:02:33 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:34455 "EHLO mail-pb0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755671Ab3JROC3 (ORCPT ); Fri, 18 Oct 2013 10:02:29 -0400 Received: by mail-pb0-f45.google.com with SMTP id mc17so3869699pbc.18 for ; Fri, 18 Oct 2013 07:02:29 -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=jyh5ton767fi0nM8K6ACPgez3/KxG3vfvtyrr9zLlrY=; b=azWrYSKbpTQ1PZz5IVvqrCM/fScD4x1oITHw7XUUflNEO2Vatv8CWCmtvckq9E6xDs 41y6Y83PdagE+dZ3pCjA1wgwh+GwQFUN1+fBb9lY7HPS8F3DDPsIbjD81KcyOqbRtDUJ 9dEsTRkOCzyoeb6i+/3PhG9F97dTsN/0BSUTDwk4NbYZXJGbXF8iwip5CxUow35LyX0N GJhpqgfML1OXhqQ/3UgQ9Mm3mVio0U5mp0hKJ8rP9EzmqHFWPeM53xo0ddEwwLTDl0hz 22S+BsZ3dF5BXanPxG4JxS7MO9vJqI4lqqlAn0GpqZrg9YsnYVxmL2eNcoYPq5gCB6+Z QoBQ== X-Gm-Message-State: ALoCoQnsta0fH32Q1R2/7l1vxHPmXEqK/OA5xm2ledMmGi1E8+aBuE/VKwxEQAj5U/lLRnSrEgwt X-Received: by 10.68.111.33 with SMTP id if1mr3177725pbb.31.1382104949085; Fri, 18 Oct 2013 07:02:29 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id xv2sm2591588pbb.39.2013.10.18.07.02.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02:28 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Viresh Kumar , Dmitry Eremin-Solenikov Subject: [PATCH V2 Resend 18/34] cpufreq: maple: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:41 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_WEB, 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 This patch converts existing .target() to newly defined light weight .target_index() routine for this driver. CPUFreq core will call cpufreq_frequency_table_target() before calling this routine and will pass index to it. Cc: Dmitry Eremin-Solenikov Signed-off-by: Viresh Kumar --- drivers/cpufreq/maple-cpufreq.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/cpufreq/maple-cpufreq.c b/drivers/cpufreq/maple-cpufreq.c index eb1e176..4e2da08 100644 --- a/drivers/cpufreq/maple-cpufreq.c +++ b/drivers/cpufreq/maple-cpufreq.c @@ -131,26 +131,18 @@ static int maple_scom_query_freq(void) */ static int maple_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) + unsigned int index) { - unsigned int newstate = 0; struct cpufreq_freqs freqs; int rc; - if (cpufreq_frequency_table_target(policy, maple_cpu_freqs, - target_freq, relation, &newstate)) - return -EINVAL; - - if (maple_pmode_cur == newstate) - return 0; - mutex_lock(&maple_switch_mutex); freqs.old = maple_cpu_freqs[maple_pmode_cur].frequency; - freqs.new = maple_cpu_freqs[newstate].frequency; + freqs.new = maple_cpu_freqs[index].frequency; cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); - rc = maple_scom_switch_freq(newstate); + rc = maple_scom_switch_freq(index); cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); mutex_unlock(&maple_switch_mutex); @@ -173,7 +165,7 @@ static struct cpufreq_driver maple_cpufreq_driver = { .flags = CPUFREQ_CONST_LOOPS, .init = maple_cpufreq_cpu_init, .verify = cpufreq_generic_frequency_table_verify, - .target = maple_cpufreq_target, + .target_index = maple_cpufreq_target, .get = maple_cpufreq_get_speed, .attr = cpufreq_generic_attr, };