From patchwork Fri Sep 13 13:01:58 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20226 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f69.google.com (mail-yh0-f69.google.com [209.85.213.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 29EC120358 for ; Fri, 13 Sep 2013 13:23:30 +0000 (UTC) Received: by mail-yh0-f69.google.com with SMTP id c41sf1252235yho.0 for ; Fri, 13 Sep 2013 06:23:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version: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=A4xu/EaW+WPNNtDm1IRXanzXLqNwUiXvNwCm6et5uEhGna78KR3gLDE0/v7M6k4oG8 5n3ebteKT7pVKLEQwFCSrbaP/Ja5ShkG3jSPudimugdsvPb+FWEWJz6vARpN7ExRetr7 qJLQ1TvSBcGTTxnul0UWwCHL1Nt7eeCKYD5mUh7+VO1e1CpjLmwCCnQedJYPYPlnDMUC kEhxTZYncWcVlEQr/liuc4jO3K8VgviQBG4oBs7wWTvoBmfhy9qztr+Jlz+eAbf/B45T N0LG8lP2CU2XYtI5ojmFU8accYkBKR7nAUXMijO5Yi5LPb2YF/EghnafMobwtTNLUbMM qN7Q== X-Gm-Message-State: ALoCoQmI047GnPTSKB1N0sLV7N9lqP9T4AFSzu/qA5mb6aFF0dekNf8W8ageAd5zuWjaoq/tSHE0 X-Received: by 10.236.80.42 with SMTP id j30mr4925938yhe.29.1379078609858; Fri, 13 Sep 2013 06:23:29 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.58.244 with SMTP id u20ls1135642qeq.74.gmail; Fri, 13 Sep 2013 06:23:29 -0700 (PDT) X-Received: by 10.52.118.41 with SMTP id kj9mr52015vdb.44.1379078609637; Fri, 13 Sep 2013 06:23:29 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id tq4si3106023vdc.103.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:23:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 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.182; Received: by mail-ve0-f182.google.com with SMTP id oy12so937302veb.41 for ; Fri, 13 Sep 2013 06:23:29 -0700 (PDT) X-Received: by 10.52.37.69 with SMTP id w5mr1336792vdj.32.1379078609550; Fri, 13 Sep 2013 06:23:29 -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 u4csp80508vcz; Fri, 13 Sep 2013 06:23:29 -0700 (PDT) X-Received: by 10.66.25.232 with SMTP id f8mr15341201pag.25.1379078608693; Fri, 13 Sep 2013 06:23:28 -0700 (PDT) Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by mx.google.com with ESMTPS id ua7si11197167pac.233.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:23:28 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.54 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.54; Received: by mail-pb0-f54.google.com with SMTP id ro12so1231957pbb.13 for ; Fri, 13 Sep 2013 06:23:28 -0700 (PDT) X-Received: by 10.68.238.34 with SMTP id vh2mr13432258pbc.101.1379078608289; Fri, 13 Sep 2013 06:23:28 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id f2sm11725345pbg.44.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:23:27 -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 172/228] cpufreq: s3c2416: Convert to light weight ->target_index() routine Date: Fri, 13 Sep 2013 18:31:58 +0530 Message-Id: <9e42a0a329defc8f0934c0b64f116d0da83a658d.1379063063.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.182 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",