From patchwork Tue Aug 13 13:32:40 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19082 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 5BBFB246B8 for ; Tue, 13 Aug 2013 13:36:32 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cd7sf1983290qab.9 for ; Tue, 13 Aug 2013 06:36:32 -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=P04JtpiylF3yRrEotn4m0Nf6/2KyV2qR4lFpOWy615k=; b=KP4v0d/jhD74NLlgt9TrkX5HCp0Mu1HSbtm1Klt1FI5O9l7stwVBT0Ir4ZDcm/zScA gfg8Z4I33wSlhsyLVvcjzGKFp695QhvV+eyQLsNuD76BCcvISgKcH0vdnH/ZyQWBorz5 Jf8VheaMSAa7YD3OIV8dDD5GwJGi98MP793kONHeuTxKbCkrNwKAmmDBgus0Z15LXme+ LmN5KD/zN+++8D55uIZ0LpurFhOEg7GHXqlWxEDJe6GYPltGxK+pkndC0nNeZbb7SJEt 8jw5qBcnENfwmKFrSKqX54smL7n35D+q0CWuQYuHCsOvkfc5MZ6/LcTg1kQ3FHfI3PzC 2cmw== X-Received: by 10.236.169.196 with SMTP id n44mr1770583yhl.9.1376400992106; Tue, 13 Aug 2013 06:36:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.34.176 with SMTP id a16ls2546235qej.63.gmail; Tue, 13 Aug 2013 06:36:32 -0700 (PDT) X-Received: by 10.58.146.196 with SMTP id te4mr99952veb.62.1376400991984; Tue, 13 Aug 2013 06:36:31 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id o7si9747977vet.93.2013.08.13.06.36.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:36:31 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 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.169; Received: by mail-ve0-f169.google.com with SMTP id db10so6651153veb.14 for ; Tue, 13 Aug 2013 06:36:31 -0700 (PDT) X-Gm-Message-State: ALoCoQlL3hMSD7RGqsPlcLzFNg3iHGZdPBzHJ+dWqPPD8S+zthlH+D4BZ8KEcHdBt+MugYFYMC63 X-Received: by 10.220.199.5 with SMTP id eq5mr4496461vcb.16.1376400991907; Tue, 13 Aug 2013 06:36:31 -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 u4csp154278vcz; Tue, 13 Aug 2013 06:36:31 -0700 (PDT) X-Received: by 10.68.179.65 with SMTP id de1mr4664081pbc.73.1376400991107; Tue, 13 Aug 2013 06:36:31 -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 tw4si25151681pbc.31.2013.08.13.06.36.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:36:31 -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 y10so4915833pdj.22 for ; Tue, 13 Aug 2013 06:36:30 -0700 (PDT) X-Received: by 10.68.220.1 with SMTP id ps1mr4622941pbc.30.1376400990678; Tue, 13 Aug 2013 06:36:30 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id nv6sm44028567pbc.6.2013.08.13.06.36.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:36:30 -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 , Kukjin Kim Subject: [PATCH V2 27/35] cpufreq: s3c2416: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:40 +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.169 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: Kukjin Kim Signed-off-by: Viresh Kumar --- drivers/cpufreq/s3c2416-cpufreq.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/s3c2416-cpufreq.c b/drivers/cpufreq/s3c2416-cpufreq.c index 8c57f10..90efbf5 100644 --- a/drivers/cpufreq/s3c2416-cpufreq.c +++ b/drivers/cpufreq/s3c2416-cpufreq.c @@ -217,24 +217,15 @@ static int s3c2416_cpufreq_leave_dvs(struct s3c2416_data *s3c_freq, int idx) } static int s3c2416_cpufreq_set_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) + unsigned int index) { struct s3c2416_data *s3c_freq = &s3c2416_cpufreq; struct cpufreq_freqs freqs; int idx, ret, to_dvs = 0; - unsigned int i; mutex_lock(&cpufreq_lock); - pr_debug("cpufreq: to %dKHz, relation %d\n", target_freq, relation); - - ret = cpufreq_frequency_table_target(policy, s3c_freq->freq_table, - target_freq, relation, &i); - if (ret != 0) - goto out; - - idx = s3c_freq->freq_table[i].driver_data; + idx = s3c_freq->freq_table[index].driver_data; if (idx == SOURCE_HCLK) to_dvs = 1; @@ -256,7 +247,7 @@ static int s3c2416_cpufreq_set_target(struct cpufreq_policy *policy, */ freqs.new = (s3c_freq->is_dvs && !to_dvs) ? clk_get_rate(s3c_freq->hclk) / 1000 - : s3c_freq->freq_table[i].frequency; + : s3c_freq->freq_table[index].frequency; pr_debug("cpufreq: Transition %d-%dkHz\n", freqs.old, freqs.new); @@ -509,7 +500,7 @@ err_hclk: static struct cpufreq_driver s3c2416_cpufreq_driver = { .flags = 0, .verify = cpufreq_generic_frequency_table_verify, - .target = s3c2416_cpufreq_set_target, + .target_index = s3c2416_cpufreq_set_target, .get = s3c2416_cpufreq_get_speed, .init = s3c2416_cpufreq_driver_init, .name = "s3c2416",