From patchwork Wed Aug 21 14:42: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: 19386 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 AEE9E248E6 for ; Wed, 21 Aug 2013 14:43:56 +0000 (UTC) Received: by mail-qa0-f70.google.com with SMTP id cd7sf885574qab.9 for ; Wed, 21 Aug 2013 07:43:56 -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=7O5+/T54CmXikMLWbt0W/tm+WzqHi9PtOkESuz5rX8A=; b=d3L9cH+4v9v1Mmlods1CefsC/VR0hkE4k0uThiARFt6SKEN6AH2nGJ+Yx90Ya+98E6 2dndfYhaguTf7mWk/nocmS5b3DOBCshnZ5nKAGq048jrNGapT5V+46brpqcRxBT9nywf +TNhOex9XMrGRXdSx0eV4ZdSU/en7XLA0MPwIR9XLqZY25KxKAp9qhqxtOWYHyKcvafO Zvn8VUQmOVkAKiBvCM7frynkGYgtQIdKLTREOI/b8bMGi7rqdDlAmmY6W1W9VBy3uC+D 6AAErN9pvnpSGFo8Q/ZJz2H/Fl130naTVguC1LNGSmb1aF9klH7B2VN8kv/4FzQ0nqUU 7Igw== X-Received: by 10.236.223.130 with SMTP id v2mr2833628yhp.34.1377096236544; Wed, 21 Aug 2013 07:43:56 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.12.166 with SMTP id z6ls693545qeb.18.gmail; Wed, 21 Aug 2013 07:43:56 -0700 (PDT) X-Received: by 10.52.73.135 with SMTP id l7mr5858830vdv.9.1377096236354; Wed, 21 Aug 2013 07:43:56 -0700 (PDT) Received: from mail-ve0-f180.google.com (mail-ve0-f180.google.com [209.85.128.180]) by mx.google.com with ESMTPS id s3si2218281vcm.76.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Aug 2013 07:43:56 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.180 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.180; Received: by mail-ve0-f180.google.com with SMTP id pb11so423666veb.11 for ; Wed, 21 Aug 2013 07:43:56 -0700 (PDT) X-Gm-Message-State: ALoCoQlMzS/F1JVMpZ98ok9du3b0Tby1IVD82zB2JHLtpoxdAm9+VPQRMIqdY7O8xtj5JQh3vQeK X-Received: by 10.52.30.48 with SMTP id p16mr5669642vdh.25.1377096236272; Wed, 21 Aug 2013 07:43:56 -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 u4csp224598vcz; Wed, 21 Aug 2013 07:43:55 -0700 (PDT) X-Received: by 10.68.253.227 with SMTP id ad3mr38729pbd.189.1377096235321; Wed, 21 Aug 2013 07:43:55 -0700 (PDT) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by mx.google.com with ESMTPS id xx4si6730493pab.23.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Aug 2013 07:43:54 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.181 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.181; Received: by mail-pd0-f181.google.com with SMTP id g10so503964pdj.26 for ; Wed, 21 Aug 2013 07:43:54 -0700 (PDT) X-Received: by 10.68.160.193 with SMTP id xm1mr85753pbb.88.1377096234364; Wed, 21 Aug 2013 07:43:54 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id pu5sm10589897pac.21.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 21 Aug 2013 07:43:53 -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 10/14] cpufreq: s3c: use cpufreq_generic_init() routine Date: Wed, 21 Aug 2013 20:12:29 +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.180 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. Cc: Kukjin Kim 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 0e13914..8d904a0 100644 --- a/drivers/cpufreq/s3c2416-cpufreq.c +++ b/drivers/cpufreq/s3c2416-cpufreq.c @@ -457,10 +457,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 a983559..8b49a06 100644 --- a/drivers/cpufreq/s3c64xx-cpufreq.c +++ b/drivers/cpufreq/s3c64xx-cpufreq.c @@ -213,9 +213,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);