From patchwork Fri Oct 18 13:59:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21146 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 49261202FF for ; Fri, 18 Oct 2013 14:02:09 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id m17sf6627586oag.7 for ; Fri, 18 Oct 2013 07:02:08 -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=G+6Otfl7Np9Y8dTiFEWZyX5CE5/VCH1ap6ypuC1i9OE=; b=lFqe5K0i3VH7YPGNSrVU3Y2QrktNqfQCbfcqp6hCMp3DAw6KKIFVRkiubqfiRSgMg0 Z+rIRNt17GgRgn5DHiKX0uqoGdKC1QL9DEbYjtsvjqfw6mO8egvlo4lOL5EGu4XF+jeS Tc5ibuL78XtLwueXDxKxBDn4lez7L60ZECEXc0VbpWXEHr2yzJgKnsqbd29cNcjUwry5 1ogyNkCYiDKieGZ6RZkKZYgT1aChIaWtbYtafZTU+H1crKN/QnJUD7DUpnhp8F88+eFk jP/jkVpnUQE0HKxMlGRZNCSvonsURl9iyuzqROrFi7RfGsFNnGe5tB/4dc/DNPaPZofP +x9g== X-Received: by 10.182.126.137 with SMTP id my9mr1157951obb.13.1382104928817; Fri, 18 Oct 2013 07:02:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.87.36 with SMTP id u4ls1294669qez.56.gmail; Fri, 18 Oct 2013 07:02:08 -0700 (PDT) X-Received: by 10.58.210.234 with SMTP id mx10mr2235517vec.9.1382104928669; Fri, 18 Oct 2013 07:02:08 -0700 (PDT) Received: from mail-ve0-f172.google.com (mail-ve0-f172.google.com [209.85.128.172]) by mx.google.com with ESMTPS id op3si332355vec.75.2013.10.18.07.02.08 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02:08 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.172 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.172; Received: by mail-ve0-f172.google.com with SMTP id cz12so1701291veb.17 for ; Fri, 18 Oct 2013 07:02:08 -0700 (PDT) X-Gm-Message-State: ALoCoQnrK1YoQZb2yJM52IbhkTJKOPPVGjZu1H6lYS0KzO1ZFpZ6RjNWM272O9pTGaLWmMY6CNsC X-Received: by 10.58.44.197 with SMTP id g5mr2201558vem.0.1382104928584; Fri, 18 Oct 2013 07:02: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 u4csp38005vcz; Fri, 18 Oct 2013 07:02:08 -0700 (PDT) X-Received: by 10.68.189.5 with SMTP id ge5mr3335909pbc.42.1382104927677; Fri, 18 Oct 2013 07:02:07 -0700 (PDT) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by mx.google.com with ESMTPS id kk1si978151pbc.244.2013.10.18.07.02.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.175 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.175; Received: by mail-pd0-f175.google.com with SMTP id g10so3759132pdj.34 for ; Fri, 18 Oct 2013 07:02:07 -0700 (PDT) X-Received: by 10.68.131.165 with SMTP id on5mr3137668pbb.165.1382104927258; Fri, 18 Oct 2013 07:02:07 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id va8sm2635325pbc.16.2013.10.18.07.02.03 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:02: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, Viresh Kumar Subject: [PATCH V2 Resend 15/34] cpufreq: kirkwood: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:38 +0530 Message-Id: <7c08d2ff7ef310d8d391f738b78a7a6110a250c4.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.172 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. Tested-by: Andrew Lunn Signed-off-by: Viresh Kumar --- drivers/cpufreq/kirkwood-cpufreq.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-cpufreq.c index fff8653..0ae4dd7 100644 --- a/drivers/cpufreq/kirkwood-cpufreq.c +++ b/drivers/cpufreq/kirkwood-cpufreq.c @@ -55,8 +55,8 @@ static unsigned int kirkwood_cpufreq_get_cpu_frequency(unsigned int cpu) return kirkwood_freq_table[0].frequency; } -static void kirkwood_cpufreq_set_cpu_state(struct cpufreq_policy *policy, - unsigned int index) +static int kirkwood_cpufreq_target(struct cpufreq_policy *policy, + unsigned int index) { struct cpufreq_freqs freqs; unsigned int state = kirkwood_freq_table[index].driver_data; @@ -100,19 +100,6 @@ static void kirkwood_cpufreq_set_cpu_state(struct cpufreq_policy *policy, local_irq_enable(); } cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); -}; - -static int kirkwood_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) -{ - unsigned int index = 0; - - if (cpufreq_frequency_table_target(policy, kirkwood_freq_table, - target_freq, relation, &index)) - return -EINVAL; - - kirkwood_cpufreq_set_cpu_state(policy, index); return 0; } @@ -126,7 +113,7 @@ static int kirkwood_cpufreq_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver kirkwood_cpufreq_driver = { .get = kirkwood_cpufreq_get_cpu_frequency, .verify = cpufreq_generic_frequency_table_verify, - .target = kirkwood_cpufreq_target, + .target_index = kirkwood_cpufreq_target, .init = kirkwood_cpufreq_cpu_init, .exit = cpufreq_generic_exit, .name = "kirkwood-cpufreq",