From patchwork Fri Sep 13 13:00:30 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20138 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ye0-f199.google.com (mail-ye0-f199.google.com [209.85.213.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A42DD20358 for ; Fri, 13 Sep 2013 13:12:59 +0000 (UTC) Received: by mail-ye0-f199.google.com with SMTP id l4sf1158397yen.2 for ; Fri, 13 Sep 2013 06:12:59 -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=hzBK3KEtY1xjT6sk/SCL8r10V1PB6Lm/Tp8JdwM8NzI=; b=WkF+8Zv+ddHfgKvAqvx1yLJbByUw2uMia2rypVrR2h8+rP0BywReO3hCKntrir9sfI UT9GbIExdsd1a++UyLPhcfijUtbgrfnAQRyMRk9uF6ndOhX7GO9GoCdrhta6PcbAWQWo 4ZsVqu9q4SqEBRB+ZbxRHl6RFhBGzLUJDiDFIN53NTZ58jiG9PPP8jbR4EUpfJCSgFCT oXpiV/o3pAFTTP1taOpdMncRKto66tefpnnruLCTJnS1NAs5FLnKYkS/lQt9jzrfAl+G nUal8K0I2ZvkeA/hiaX95jOQIYCNToVAHBFIO/wzmr2HVXVNe1DvBmoKAqWPbuWLnUny BYsg== X-Gm-Message-State: ALoCoQkxX3NljuoL3kBD3qRN1M1ZD8j9gUjcVx5Q5ftUY6AdDcuxXWBKbN0O04kG1vV37k5+zUHe X-Received: by 10.236.142.38 with SMTP id h26mr317275yhj.57.1379077979286; Fri, 13 Sep 2013 06:12:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.111 with SMTP id gd15ls1133657qeb.68.gmail; Fri, 13 Sep 2013 06:12:59 -0700 (PDT) X-Received: by 10.220.169.203 with SMTP id a11mr1649823vcz.26.1379077978919; Fri, 13 Sep 2013 06:12:58 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id bq2si3096259vcb.115.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:12:58 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 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.177; Received: by mail-ve0-f177.google.com with SMTP id db12so917983veb.22 for ; Fri, 13 Sep 2013 06:12:58 -0700 (PDT) X-Received: by 10.52.122.68 with SMTP id lq4mr10105396vdb.21.1379077978851; Fri, 13 Sep 2013 06:12:58 -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 u4csp79935vcz; Fri, 13 Sep 2013 06:12:58 -0700 (PDT) X-Received: by 10.67.23.71 with SMTP id hy7mr15038075pad.99.1379077977912; Fri, 13 Sep 2013 06:12:57 -0700 (PDT) Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by mx.google.com with ESMTPS id if6si7416628pbc.223.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:12:57 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.52 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.52; Received: by mail-pa0-f52.google.com with SMTP id kq13so2498090pab.39 for ; Fri, 13 Sep 2013 06:12:57 -0700 (PDT) X-Received: by 10.66.25.133 with SMTP id c5mr15200647pag.4.1379077977470; Fri, 13 Sep 2013 06:12:57 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id wd6sm18054168pab.3.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:12:56 -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 084/228] cpufreq: sc520: Use generic cpufreq routines Date: Fri, 13 Sep 2013 18:30:30 +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.177 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: , Most of the CPUFreq drivers do similar things in .exit() and .verify() routines and .attr. So its better if we have generic routines for them which can be used by cpufreq drivers then. This patch uses these generic routines for this driver. Signed-off-by: Viresh Kumar --- drivers/cpufreq/sc520_freq.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/drivers/cpufreq/sc520_freq.c b/drivers/cpufreq/sc520_freq.c index bb9c0de..8556225 100644 --- a/drivers/cpufreq/sc520_freq.c +++ b/drivers/cpufreq/sc520_freq.c @@ -78,11 +78,6 @@ static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy, cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); }; -static int sc520_freq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, &sc520_freq_table[0]); -} - static int sc520_freq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) @@ -120,27 +115,14 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy) } -static int sc520_freq_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - - -static struct freq_attr *sc520_freq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - - static struct cpufreq_driver sc520_freq_driver = { .get = sc520_freq_get_cpu_frequency, - .verify = sc520_freq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = sc520_freq_target, .init = sc520_freq_cpu_init, - .exit = sc520_freq_cpu_exit, + .exit = cpufreq_generic_exit, .name = "sc520_freq", - .attr = sc520_freq_attr, + .attr = cpufreq_generic_attr, }; static const struct x86_cpu_id sc520_ids[] = {