From patchwork Fri Oct 18 13:59:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21140 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2C1C6202FF for ; Fri, 18 Oct 2013 14:01:24 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id x20sf7626659qcv.7 for ; Fri, 18 Oct 2013 07:01:24 -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=04qd0VCAWIpmAiQ3kvqBn+P3jDP6YvjThieWaIUPzS4=; b=bDvmE3abZIFk1gb43LazZzEiaXTF0fxHO3nRKtOH7nnzhpmJp0qM2GKt7DyHpgsKOQ x2FQy4PX5Kuf1nvMBSZSwbVeMc3R28+/t9TKoneoDELqrDbxs8FW3Tkjzv2CzPhpk2tL AM9GEoqFgmuh/tc9baYCFtOxnj4iXgQNnFJIjpxgOrCGJD9dC+416nt5qHKFkOyGvCFg +0IR3GHI/VbUK1OsJaVRTpw3VXgPKdCJ3oUyU40r+hMuzC8z+A+t0x2LKHtXDV/245Ln 1sNZiY/gDFJgcHcVcZJA7vWVMuvXui+xnIXZcKURtbecTZ5twh5S8Ell40Ho8AHJq8Ns O46A== X-Received: by 10.236.142.38 with SMTP id h26mr1498708yhj.57.1382104883989; Fri, 18 Oct 2013 07:01:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.81.9 with SMTP id v9ls1272132qex.99.gmail; Fri, 18 Oct 2013 07:01:23 -0700 (PDT) X-Received: by 10.221.58.212 with SMTP id wl20mr1498574vcb.19.1382104883872; Fri, 18 Oct 2013 07:01:23 -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 jb3si336385vdb.27.2013.10.18.07.01.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:01:23 -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 db12so2128670veb.29 for ; Fri, 18 Oct 2013 07:01:23 -0700 (PDT) X-Gm-Message-State: ALoCoQnCtKS4zYTlxvRcB8Ja/nfwoMjufvmCka2d5GQkOXIMvgWG67AGnt8Ze7AadB7TlrZw0KLA X-Received: by 10.221.40.10 with SMTP id to10mr631893vcb.22.1382104883771; Fri, 18 Oct 2013 07:01:23 -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 u4csp37945vcz; Fri, 18 Oct 2013 07:01:23 -0700 (PDT) X-Received: by 10.66.25.82 with SMTP id a18mr2995086pag.171.1382104882767; Fri, 18 Oct 2013 07:01:22 -0700 (PDT) Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by mx.google.com with ESMTPS id iu9si1569035pac.176.2013.10.18.07.01.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:01:22 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.179 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.179; Received: by mail-pd0-f179.google.com with SMTP id y10so1621489pdj.24 for ; Fri, 18 Oct 2013 07:01:21 -0700 (PDT) X-Received: by 10.68.182.3 with SMTP id ea3mr3291383pbc.124.1382104881643; Fri, 18 Oct 2013 07:01:21 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id yo2sm4630218pab.8.2013.10.18.07.01.17 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:01:21 -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 09/34] cpufreq: dbx500: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:32 +0530 Message-Id: <69ad3458c0c8cb61eb154e7d7dd07436abf31bc5.1382104515.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. Acked-by: Linus Walleij Signed-off-by: Viresh Kumar --- drivers/cpufreq/dbx500-cpufreq.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c index a60f769..238b169 100644 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ b/drivers/cpufreq/dbx500-cpufreq.c @@ -20,23 +20,13 @@ static struct cpufreq_frequency_table *freq_table; static struct clk *armss_clk; static int dbx500_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) + unsigned int index) { struct cpufreq_freqs freqs; - unsigned int idx; int ret; - /* Lookup the next frequency */ - if (cpufreq_frequency_table_target(policy, freq_table, target_freq, - relation, &idx)) - return -EINVAL; - freqs.old = policy->cur; - freqs.new = freq_table[idx].frequency; - - if (freqs.old == freqs.new) - return 0; + freqs.new = freq_table[index].frequency; /* pre-change notification */ cpufreq_notify_transition(policy, &freqs, CPUFREQ_PRECHANGE); @@ -80,7 +70,7 @@ static int dbx500_cpufreq_init(struct cpufreq_policy *policy) static struct cpufreq_driver dbx500_cpufreq_driver = { .flags = CPUFREQ_STICKY | CPUFREQ_CONST_LOOPS, .verify = cpufreq_generic_frequency_table_verify, - .target = dbx500_cpufreq_target, + .target_index = dbx500_cpufreq_target, .get = dbx500_cpufreq_getspeed, .init = dbx500_cpufreq_init, .name = "DBX500",