From patchwork Fri Sep 13 13:01:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20196 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A3C9420358 for ; Fri, 13 Sep 2013 13:19:49 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id oy12sf1230058veb.11 for ; Fri, 13 Sep 2013 06:19:49 -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=DJMmjoO69SGfN/BVW1vYg2LBNNjKXA79KEfS+8e49Vc=; b=jKTzESOtI+qSyLJnBFaaszGTAVnAsiuYE5sbsFzcnTj11oTl6hF8Wv8XC5oQV9pRPQ lAWf78N3UWqKqz++liZKBwgX4NMjUm9GCaO5EfN12CNWO9NtSlY6TL3lrFjqRNwnsmsO EAqzuIjfDDjlRgNXFgJsexuNd9cNb6i0Sz8hzC2OYAOr9WLwAFRJIdY9XDh0/fEBIoxn jgSgiY9p7LF/h9gbx0sFWgJk0ch/3z86HtBXMIKABTAeDoU+UVpP2i8/gkoUFaGCwdbm aEu4yA2cFSu8VSwXpVoYT3jigniB4JsK7nbilK87x0t9/wrcl5vtrsFDp+o4h68+leWp sZOg== X-Gm-Message-State: ALoCoQnncIgQCFST1unrr2Rq6ifF3InzKvWdmg1RPJ/Sq9Smiafe0MNaH5O1dZ87iyg+BMGL5Ta4 X-Received: by 10.236.145.34 with SMTP id o22mr5177639yhj.22.1379078389419; Fri, 13 Sep 2013 06:19:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.82.49 with SMTP id f17ls1167366qey.33.gmail; Fri, 13 Sep 2013 06:19:49 -0700 (PDT) X-Received: by 10.58.218.225 with SMTP id pj1mr1677016vec.24.1379078389203; Fri, 13 Sep 2013 06:19:49 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id o10si3100057vco.140.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:19:49 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id gd11so900479vcb.19 for ; Fri, 13 Sep 2013 06:19:49 -0700 (PDT) X-Received: by 10.52.119.228 with SMTP id kx4mr10052477vdb.12.1379078389117; Fri, 13 Sep 2013 06:19:49 -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 u4csp80294vcz; Fri, 13 Sep 2013 06:19:48 -0700 (PDT) X-Received: by 10.68.164.228 with SMTP id yt4mr13146317pbb.77.1379078388014; Fri, 13 Sep 2013 06:19:48 -0700 (PDT) Received: from mail-pd0-f170.google.com (mail-pd0-f170.google.com [209.85.192.170]) by mx.google.com with ESMTPS id gl2si7417946pbc.318.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:19:48 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.170 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.170; Received: by mail-pd0-f170.google.com with SMTP id x10so1254068pdj.1 for ; Fri, 13 Sep 2013 06:19:47 -0700 (PDT) X-Received: by 10.66.196.110 with SMTP id il14mr15420561pac.130.1379078387608; Fri, 13 Sep 2013 06:19:47 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id f2sm11704846pbg.44.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:19:47 -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 Subject: [PATCH 142/228] cpufreq: s3c: use cpufreq_generic_init() routine Date: Fri, 13 Sep 2013 18:31:28 +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.220.174 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: , Use generic cpufreq_generic_init() routine instead of replicating the same code here. Signed-off-by: Viresh Kumar --- drivers/cpufreq/s3c2416-cpufreq.c | 6 ++---- drivers/cpufreq/s3c24xx-cpufreq.c | 13 +------------ drivers/cpufreq/s3c64xx-cpufreq.c | 5 ++--- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/drivers/cpufreq/s3c2416-cpufreq.c b/drivers/cpufreq/s3c2416-cpufreq.c index 22c4c2d..26a35d1 100644 --- a/drivers/cpufreq/s3c2416-cpufreq.c +++ b/drivers/cpufreq/s3c2416-cpufreq.c @@ -479,10 +479,8 @@ static int __init s3c2416_cpufreq_driver_init(struct cpufreq_policy *policy) /* Datasheet says PLL stabalisation time must be at least 300us, * so but add some fudge. (reference in LOCKCON0 register description) */ - policy->cpuinfo.transition_latency = (500 * 1000) + - s3c_freq->regulator_latency; - - ret = cpufreq_table_validate_and_show(policy, s3c_freq->freq_table); + ret = cpufreq_generic_init(policy, s3c_freq->freq_table, + (500 * 1000) + s3c_freq->regulator_latency); if (ret) goto err_freq_table; diff --git a/drivers/cpufreq/s3c24xx-cpufreq.c b/drivers/cpufreq/s3c24xx-cpufreq.c index e0fbaef..4850882 100644 --- a/drivers/cpufreq/s3c24xx-cpufreq.c +++ b/drivers/cpufreq/s3c24xx-cpufreq.c @@ -373,18 +373,7 @@ struct clk *s3c_cpufreq_clk_get(struct device *dev, const char *name) static int s3c_cpufreq_init(struct cpufreq_policy *policy) { - printk(KERN_INFO "%s: initialising policy %p\n", __func__, policy); - - if (policy->cpu != 0) - return -EINVAL; - - /* feed the latency information from the cpu driver */ - policy->cpuinfo.transition_latency = cpu_cur.info->latency; - - if (ftab) - return cpufreq_table_validate_and_show(policy, ftab); - - return 0; + return cpufreq_generic_init(policy, ftab, cpu_cur.info->latency); } static int __init s3c_cpufreq_initclks(void) diff --git a/drivers/cpufreq/s3c64xx-cpufreq.c b/drivers/cpufreq/s3c64xx-cpufreq.c index a66cfa3..16dc315 100644 --- a/drivers/cpufreq/s3c64xx-cpufreq.c +++ b/drivers/cpufreq/s3c64xx-cpufreq.c @@ -239,9 +239,8 @@ static int s3c64xx_cpufreq_driver_init(struct cpufreq_policy *policy) * the PLLs, which we don't currently) is ~300us worst case, * but add some fudge. */ - policy->cpuinfo.transition_latency = (500 * 1000) + regulator_latency; - - ret = cpufreq_table_validate_and_show(policy, s3c64xx_freq_table); + ret = cpufreq_generic_init(policy, s3c64xx_freq_table, + (500 * 1000) + regulator_latency); if (ret != 0) { pr_err("Failed to configure frequency table: %d\n", ret);