From patchwork Tue Aug 13 13:32:29 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19071 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f199.google.com (mail-qc0-f199.google.com [209.85.216.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DCD18246B8 for ; Tue, 13 Aug 2013 13:35:10 +0000 (UTC) Received: by mail-qc0-f199.google.com with SMTP id j10sf9587723qcx.2 for ; Tue, 13 Aug 2013 06:35:10 -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=Uj1sdj0nFEGgSqQ8PaKGn9d3hoKSDRNeQ7b6SJ0zmmU=; b=hyAjMlV6jSuEauJI6uAEe2p9hHU48gq51WMgDueYbbTOiAZPDogg2Wu5aYKoj2xES3 haZdr9WMi2PqrdeEnje1xaSmlGsLs5ZXyp1MSo9nsSEHbt1Xz9CD9XU2EaDAV3vB8eap +PxIzsJH35yUWgxggBkgcGO1ZCPgqEM4mxmU0r1sDlWG7lHMFVlrJT2ijfsYdkrriTzz OywVxBhYQfraW9BWQAmEnlH6A/tV/PJ01QcBZAaXHo54fq64H8K18xJwxqVzGHc2df2H ySSdoGveWdhqjmJTJd2OzCHgqtKrdn6Fh/MqVzMmDGX3gwHaNoIYWCkdGKSDMQHX07rS ULdg== X-Received: by 10.236.109.199 with SMTP id s47mr1732219yhg.2.1376400910660; Tue, 13 Aug 2013 06:35:10 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.83.7 with SMTP id m7ls926462qey.0.gmail; Tue, 13 Aug 2013 06:35:10 -0700 (PDT) X-Received: by 10.52.73.229 with SMTP id o5mr453886vdv.54.1376400910508; Tue, 13 Aug 2013 06:35:10 -0700 (PDT) Received: from mail-ve0-f171.google.com (mail-ve0-f171.google.com [209.85.128.171]) by mx.google.com with ESMTPS id gq10si9750386vdc.30.2013.08.13.06.35.10 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:10 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.171 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.171; Received: by mail-ve0-f171.google.com with SMTP id pa12so6649986veb.2 for ; Tue, 13 Aug 2013 06:35:10 -0700 (PDT) X-Gm-Message-State: ALoCoQmEUqKoEoia3/WHVVKmS3hc0vEuj3MSsyO7hHY5ot7+6V3ngYE5xOEYgLv7QmEe687yZ39j X-Received: by 10.52.34.74 with SMTP id x10mr3745553vdi.13.1376400910417; Tue, 13 Aug 2013 06:35:10 -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 u4csp154203vcz; Tue, 13 Aug 2013 06:35:09 -0700 (PDT) X-Received: by 10.68.254.138 with SMTP id ai10mr4648000pbd.151.1376400909510; Tue, 13 Aug 2013 06:35:09 -0700 (PDT) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by mx.google.com with ESMTPS id co1si25102245pbc.228.2013.08.13.06.35.09 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:09 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.177 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.177; Received: by mail-pd0-f177.google.com with SMTP id y10so4881769pdj.36 for ; Tue, 13 Aug 2013 06:35:09 -0700 (PDT) X-Received: by 10.68.131.168 with SMTP id on8mr4617373pbb.97.1376400909105; Tue, 13 Aug 2013 06:35:09 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id ht5sm43985826pbb.29.2013.08.13.06.35.05 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:08 -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 , Andrew Lunn Subject: [PATCH V2 16/35] cpufreq: kirkwood: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:29 +0530 Message-Id: <9dd618d939eccf2588a2cc0f1d161c6fb1e2d6f1.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.171 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. Cc: 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 9018c4d..d0d107a 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; } @@ -130,7 +117,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",