From patchwork Fri Sep 13 13:01:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20216 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C434D20358 for ; Fri, 13 Sep 2013 13:22:08 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id i72sf1254033yha.1 for ; Fri, 13 Sep 2013 06:22:08 -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 :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=q4ISBPONjD/5YdPh+XvWvYZ87ES/av8cnxuJrEVU3tI=; b=OxNS7nSQFE7lcFsS/z0q42Jvinito5Z5MMpyLJkRhVJFyQJkMg2PCwdyEa4tKyNs6P IaQc5sovNEDAr7HqaIQQjm2K1PWoHlM0wnhwQntrVa+3I358CIbdqubtGynpiEWLcQf4 eFrHU8BACCn20PSuOrpod01DIYtlvEAeG/klGuFDh+NSBMwmjwXi/ZZOTc9m2kEvGNmj JClK/lxzqY8ZXdrsbG/ANeCKcGzZdLBVxoYGTdPhmjSeDNZMGwNnOtND+/EHSx7ZL/8Q c91vdw8hKPYKAvN0JuqJVTZ7cODO5u83iArjLzoxbhxe+pLJhAriaUG3UB71lX1r/vCj dhng== X-Gm-Message-State: ALoCoQmw21CxFdzu2ebYwypbwjlrjdirfSD5gr6Z7/S4qvjOaKhwJRBPj/ZVn5mHaKcGsNT1KrQv X-Received: by 10.236.216.17 with SMTP id f17mr365244yhp.18.1379078528566; Fri, 13 Sep 2013 06:22:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.94.68 with SMTP id da4ls1134270qeb.24.gmail; Fri, 13 Sep 2013 06:22:08 -0700 (PDT) X-Received: by 10.220.46.72 with SMTP id i8mr12185270vcf.10.1379078528371; Fri, 13 Sep 2013 06:22:08 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id gw1si3103762vcb.137.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hf12so918191vcb.13 for ; Fri, 13 Sep 2013 06:22:08 -0700 (PDT) X-Received: by 10.58.161.116 with SMTP id xr20mr11983126veb.2.1379078528286; Fri, 13 Sep 2013 06:22:08 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp80434vcz; Fri, 13 Sep 2013 06:22:07 -0700 (PDT) X-Received: by 10.68.13.3 with SMTP id d3mr13729155pbc.62.1379078527394; Fri, 13 Sep 2013 06:22:07 -0700 (PDT) Received: from mail-pa0-f41.google.com (mail-pa0-f41.google.com [209.85.220.41]) by mx.google.com with ESMTPS id uh5si11197867pab.209.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.41 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.41; Received: by mail-pa0-f41.google.com with SMTP id bj1so2528211pad.14 for ; Fri, 13 Sep 2013 06:22:07 -0700 (PDT) X-Received: by 10.66.248.130 with SMTP id ym2mr2046708pac.177.1379078526976; Fri, 13 Sep 2013 06:22:06 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id xs1sm18094289pac.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:22:06 -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, linux-arm-kernel@lists.infradead.org, Viresh Kumar Subject: [PATCH 162/228] cpufreq: longhaul: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:48 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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. Signed-off-by: Viresh Kumar --- drivers/cpufreq/longhaul.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c index 14df497..45bafdd 100644 --- a/drivers/cpufreq/longhaul.c +++ b/drivers/cpufreq/longhaul.c @@ -626,21 +626,12 @@ static void longhaul_setup_voltagescaling(void) static int longhaul_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) + unsigned int table_index) { - unsigned int table_index = 0; unsigned int i; unsigned int dir = 0; u8 vid, current_vid; - if (cpufreq_frequency_table_target(policy, longhaul_table, target_freq, - relation, &table_index)) - return -EINVAL; - - /* Don't set same frequency again */ - if (longhaul_index == table_index) - return 0; - if (!can_scale_voltage) longhaul_setstate(policy, table_index); else { @@ -919,7 +910,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver longhaul_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target = longhaul_target, + .target_index = longhaul_target, .get = longhaul_get, .init = longhaul_cpu_init, .exit = cpufreq_generic_exit,