From patchwork Fri Oct 18 13:59:49 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21157 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f197.google.com (mail-pd0-f197.google.com [209.85.192.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B8C9E202FF for ; Fri, 18 Oct 2013 14:03:32 +0000 (UTC) Received: by mail-pd0-f197.google.com with SMTP id w10sf6124249pde.0 for ; Fri, 18 Oct 2013 07:03:32 -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=PB2sso5KRlgJS6AxPbYh+O4dHox4s2FXSvAIF7j0cmE=; b=HUlhTzjGlriC7Fe6LmXGCWd0DLQhKaxYnvz1FMvgA3JTOaPZk+QNVCoz9qFWHYn2BG zLgU5D7aZ0dvRRbm4/PMJsQ1Gt8shukpjgCRB/xL/5xuT+HiQJYrsOd+u7HRUka0vCFp ctqVEyXEtZ9P6hbwq8/+e3UI67mygA2UxbKlsfP02Lwdaggw/q0MHq27SlS8FyvPlyMx VrYIvwAnXSft7M8cnUhEoNgwR0MiPwk8MDVesl2jqFoZrnZkntbzzSun0X9KbFsl8sqH JLbFQ+R1YgWFT6pdlxfcFFp0YNhPKPAApEv0tvvneaca9QaO7fGmlkEH8OhJkVv440Nf 7scg== X-Received: by 10.66.160.168 with SMTP id xl8mr1346004pab.14.1382105012090; Fri, 18 Oct 2013 07:03:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.134.74 with SMTP id pi10ls1278088qeb.35.gmail; Fri, 18 Oct 2013 07:03:31 -0700 (PDT) X-Received: by 10.58.133.77 with SMTP id pa13mr656374veb.21.1382105011866; Fri, 18 Oct 2013 07:03:31 -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 cp3si335520vcb.58.2013.10.18.07.03.31 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:03:31 -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 cz12so1702364veb.17 for ; Fri, 18 Oct 2013 07:03:31 -0700 (PDT) X-Gm-Message-State: ALoCoQllAfOkeLor9IdiZqoWXFQ8xZAVG+cIpVnxvGRok2CwJ6/7KB5bmtHb8/9CNv3Dj5etRwwI X-Received: by 10.58.44.197 with SMTP id g5mr2207349vem.0.1382105011780; Fri, 18 Oct 2013 07:03: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 u4csp38130vcz; Fri, 18 Oct 2013 07:03:31 -0700 (PDT) X-Received: by 10.66.168.7 with SMTP id zs7mr3759056pab.152.1382105010860; Fri, 18 Oct 2013 07:03:30 -0700 (PDT) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com [209.85.192.169]) by mx.google.com with ESMTPS id sj5si1600599pab.23.2013.10.18.07.03.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:03:30 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.169 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.169; Received: by mail-pd0-f169.google.com with SMTP id q10so3241624pdj.14 for ; Fri, 18 Oct 2013 07:03:30 -0700 (PDT) X-Received: by 10.66.144.225 with SMTP id sp1mr817433pab.190.1382105010454; Fri, 18 Oct 2013 07:03:30 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id b3sm2661585pbh.7.2013.10.18.07.03.26 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:03:29 -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 , Kukjin Kim Subject: [PATCH V2 Resend 26/34] cpufreq: s3c2416: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:49 +0530 Message-Id: <169ad15eec7006763101a9cce526ee489f457df7.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. 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 26a35d1..4188acc 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); @@ -505,7 +496,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",