From patchwork Fri Oct 18 13:59:39 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21147 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id AD1AB202FF for ; Fri, 18 Oct 2013 14:02:16 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id fa1sf6410969pad.9 for ; Fri, 18 Oct 2013 07:02:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=q4ISBPONjD/5YdPh+XvWvYZ87ES/av8cnxuJrEVU3tI=; b=LNxx0z0G+osctFET3CSK3C9vARLx6bMAK9v4mFS5EPUIyOXs0Vj6TTj9VMCe9X/xgi s/3Jh6F/ddadI14wYOZMQINskqNOsMXg55cAefAyfaCr8f0yfk+SSPTZotuETrl+BFJp 7yRm04KAgzJ8TUF2AXCj9kzuYQ/JO/rnxB9uAd/rVmel6rNeYFdX4OzcQaLDcKgZcq4D LiWZOT9Mm2pZiGqnuaoZW44Mtqb0T9f7n2/HBd3dbKEc/fey/TLv3lTUHAlvQYvxb6pL xjlkf3iI1yAJ9SZCrJ9VwoqnVWfNRS4PfsqxvdZsyDFGTsbKGbkIb89PA7P4vxt3q6sA r0sQ== X-Received: by 10.66.136.47 with SMTP id px15mr1296041pab.28.1382104935921; Fri, 18 Oct 2013 07:02:15 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.99.67 with SMTP id eo3ls1268952qeb.41.gmail; Fri, 18 Oct 2013 07:02:15 -0700 (PDT) X-Received: by 10.58.143.17 with SMTP id sa17mr2271374veb.14.1382104935712; Fri, 18 Oct 2013 07:02:15 -0700 (PDT) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id n8si327503vez.119.2013.10.18.07.02.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02:15 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.178 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.178; Received: by mail-ve0-f178.google.com with SMTP id jy13so1979542veb.23 for ; Fri, 18 Oct 2013 07:02:15 -0700 (PDT) X-Gm-Message-State: ALoCoQnmxH1vd2+s/KtoWC8tEepdk4mLfvx942ewV6Jr1C8p1Krnp03+IBrk1jhbnbAP1fBnjlZ4 X-Received: by 10.58.161.231 with SMTP id xv7mr2193157veb.2.1382104935639; Fri, 18 Oct 2013 07:02:15 -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 u4csp38018vcz; Fri, 18 Oct 2013 07:02:15 -0700 (PDT) X-Received: by 10.68.197.234 with SMTP id ix10mr2501975pbc.185.1382104934737; Fri, 18 Oct 2013 07:02:14 -0700 (PDT) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by mx.google.com with ESMTPS id iu9si1591208pac.60.2013.10.18.07.02.14 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02:14 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.170 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.170; Received: by mail-pd0-f170.google.com with SMTP id x10so4700991pdj.15 for ; Fri, 18 Oct 2013 07:02:14 -0700 (PDT) X-Received: by 10.66.141.73 with SMTP id rm9mr3636334pab.167.1382104934336; Fri, 18 Oct 2013 07:02:14 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id sb9sm2663153pbb.0.2013.10.18.07.02.10 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02:13 -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 Subject: [PATCH V2 Resend 16/34] cpufreq: longhaul: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:39 +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.128.178 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,