From patchwork Tue Aug 13 13:32:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19072 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f70.google.com (mail-qa0-f70.google.com [209.85.216.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B49E0246B8 for ; Tue, 13 Aug 2013 13:35:18 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cd7sf4083427qab.5 for ; Tue, 13 Aug 2013 06:35:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state: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=N9dR2LeU54t4ZYAZk1UaXBcOQVHhcFvnCBqIijhvSCM=; b=i9P9+7+s8v4pLB/wdFOM1q8v0mdZOyTYIzKfIp5PJbaJU2KLk9EuNPTvkkPCZv6GJs eoNYXMzs6uZLTpXI/Xgeb4XOuU+SCStDoRZQCLYJAgWVJsfkGWKa7iih+RZ+CMd+xo5F pZFZqbzmi7DpBMSePKFXzNUQj5XxZ4vMmW1tVWkZpiWz82/r95WpTQRikO8nO/SIbpFb uEbkks2QzmTqm2q/S//N66JR/v3I25R/HEDnGAzYcNCVvzncvRUZqfeCPRKxTVBdevtq Bj3BUYuIxYrPHMY1TqeevoPvvzoJzZSFfn1OL0HzZpHAMUYzJwvcB8l8A066CHtt1Dpg AKlw== X-Received: by 10.236.221.198 with SMTP id r66mr1717611yhp.5.1376400918395; Tue, 13 Aug 2013 06:35:18 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.97.66 with SMTP id dy2ls133754qeb.85.gmail; Tue, 13 Aug 2013 06:35:18 -0700 (PDT) X-Received: by 10.58.211.227 with SMTP id nf3mr4536522vec.20.1376400918265; Tue, 13 Aug 2013 06:35:18 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id f8si9753835vec.9.2013.08.13.06.35.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:18 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.170 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id 15so6694720vea.15 for ; Tue, 13 Aug 2013 06:35:18 -0700 (PDT) X-Gm-Message-State: ALoCoQlSte+1D3NeOTPvQBf24tPYuch2JALZF/5ArLDmUyqUaSV9t9+ZXnusswdXQ2tLpsX1bLnT X-Received: by 10.221.49.8 with SMTP id uy8mr92295vcb.65.1376400918187; Tue, 13 Aug 2013 06:35:18 -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 u4csp154210vcz; Tue, 13 Aug 2013 06:35:17 -0700 (PDT) X-Received: by 10.68.137.1 with SMTP id qe1mr4724768pbb.25.1376400917119; Tue, 13 Aug 2013 06:35:17 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id aq4si25115093pbd.176.2013.08.13.06.35.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:17 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.50; Received: by mail-pb0-f50.google.com with SMTP id uo5so8027890pbc.37 for ; Tue, 13 Aug 2013 06:35:16 -0700 (PDT) X-Received: by 10.67.11.103 with SMTP id eh7mr4659568pad.153.1376400916710; Tue, 13 Aug 2013 06:35:16 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id qh10sm43979061pbb.33.2013.08.13.06.35.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:16 -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 V2 17/35] cpufreq: longhaul: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:30 +0530 Message-Id: <65691d6e5ef6f37f54774a5f33c30cbe43bed042.1376392602.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-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.128.170 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 57d7b02..e566776 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 { @@ -920,7 +911,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,