From patchwork Sat Aug 10 06:44:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 18955 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C936C246EB for ; Sat, 10 Aug 2013 06:50:34 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf2405091vcb.11 for ; Fri, 09 Aug 2013 23:50:34 -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=pwuuxKezswT+dj5qneXFfu7F2MWg2Jc6rH1OQFEjYsM=; b=NX46DRG0VvG5PJeqympTddBgyxfdChmPoeWa6aTEIojBGs124SxfOTu7e9LNazDnYi 64Q8vYw0lkl1EdPAixfLlzXVwLwISpVpktJhqZ3jI+4TKfV8WueWOHv+9xC96CUMyjV+ vm3pnuZhrKjEnTBCpJ13z1lTHFwo7+OE13tlmoG8m2vF5YNHdE0XNmZbqoc6WKubonrm vxcPcEfLfsIx4i+M2PI8R4ExNc04umfjmKcgna59EjQv7XiT2jmAsOCmfRJkH+Mqie8L vqj6gRIucKQCIbOOxlcd0PhZ0bd8ZHESK6rK+ErGZemWsKGQz5L+HCs81j7NY2V8ihYB PU+Q== X-Received: by 10.236.112.33 with SMTP id x21mr6625195yhg.57.1376117434255; Fri, 09 Aug 2013 23:50:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.116.168 with SMTP id jx8ls1328274qeb.34.gmail; Fri, 09 Aug 2013 23:50:34 -0700 (PDT) X-Received: by 10.52.53.5 with SMTP id x5mr1886944vdo.101.1376117434148; Fri, 09 Aug 2013 23:50:34 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id xs10si5683705vcb.43.2013.08.09.23.50.34 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.178 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.178; Received: by mail-vc0-f178.google.com with SMTP id ha12so1642963vcb.9 for ; Fri, 09 Aug 2013 23:50:34 -0700 (PDT) X-Gm-Message-State: ALoCoQnzf1molX5XNBjgjDnMgMg9qL27SKSM4Sz4BXA1DpPm2BPHhp/GeW+DBkT6iIPj4mcAUxlA X-Received: by 10.52.243.201 with SMTP id xa9mr1791659vdc.106.1376117434040; Fri, 09 Aug 2013 23:50:34 -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 u4csp174vcz; Fri, 9 Aug 2013 23:50:33 -0700 (PDT) X-Received: by 10.66.74.65 with SMTP id r1mr14851386pav.81.1376117433195; Fri, 09 Aug 2013 23:50:33 -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 hb3si15781865pac.123.2013.08.09.23.50.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:33 -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 x10so1397430pdj.15 for ; Fri, 09 Aug 2013 23:50:32 -0700 (PDT) X-Received: by 10.68.17.230 with SMTP id r6mr14893923pbd.112.1376117432802; Fri, 09 Aug 2013 23:50:32 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id w8sm26672941paj.4.2013.08.09.23.50.29 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 09 Aug 2013 23:50:32 -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 , Andrew Lunn Subject: [PATCH 22/44] cpufreq: kirkwood: Use generic cpufreq routines Date: Sat, 10 Aug 2013 12:14:18 +0530 Message-Id: <4651cb39618a41f6f4f5ba16946120ad7c5e7430.1376116345.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.220.178 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. Cc: Andrew Lunn Signed-off-by: Viresh Kumar --- drivers/cpufreq/kirkwood-cpufreq.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-cpufreq.c index 336f171..9018c4d 100644 --- a/drivers/cpufreq/kirkwood-cpufreq.c +++ b/drivers/cpufreq/kirkwood-cpufreq.c @@ -102,11 +102,6 @@ static void kirkwood_cpufreq_set_cpu_state(struct cpufreq_policy *policy, cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); }; -static int kirkwood_cpufreq_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, kirkwood_freq_table); -} - static int kirkwood_cpufreq_target(struct cpufreq_policy *policy, unsigned int target_freq, unsigned int relation) @@ -132,25 +127,14 @@ static int kirkwood_cpufreq_cpu_init(struct cpufreq_policy *policy) return cpufreq_table_validate_and_show(policy, kirkwood_freq_table); } -static int kirkwood_cpufreq_cpu_exit(struct cpufreq_policy *policy) -{ - cpufreq_frequency_table_put_attr(policy->cpu); - return 0; -} - -static struct freq_attr *kirkwood_cpufreq_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver kirkwood_cpufreq_driver = { .get = kirkwood_cpufreq_get_cpu_frequency, - .verify = kirkwood_cpufreq_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = kirkwood_cpufreq_target, .init = kirkwood_cpufreq_cpu_init, - .exit = kirkwood_cpufreq_cpu_exit, + .exit = cpufreq_generic_exit, .name = "kirkwood-cpufreq", - .attr = kirkwood_cpufreq_attr, + .attr = cpufreq_generic_attr, }; static int kirkwood_cpufreq_probe(struct platform_device *pdev)