From patchwork Fri Sep 13 13:00:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 20123 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f199.google.com (mail-vc0-f199.google.com [209.85.220.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CFF0620358 for ; Fri, 13 Sep 2013 13:11:14 +0000 (UTC) Received: by mail-vc0-f199.google.com with SMTP id gf11sf1189168vcb.10 for ; Fri, 13 Sep 2013 06:11:14 -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=u2LcJIgWV962Fcfc8qO4ThKSkDqv4KsA8UQ3cDzne+8=; b=KN5ZScYYYxQA/kevVFU0FYCwIuu3ap1xq6/ZbhRlsmo72Q9Hkxv+txXh3Adn0MNSW4 WBh5ZpQFxP+LReHhDZ4S4+t3tm+ciFJ449BL6xWaEUG7OWpVxgD0WvzRg5XG6M5N5Evj sKHk5UKD0NZ6fojmhBUTjy1dXV/uXYvlmkTojbqP5VpsalUQJBec2fIr9w1op5HeEvl4 VwtBW0nu6gPaXD9pHHQW0rKqSXXo+fM6CbJIVv2kypqlsG1NawW7rfToY0o8KQT2UWGl kthmFEw60mqcqYw+hFh13tfjKG8wG6nm1FA35fHlLbwh/SGPLzhLdjMtcmXbydh9zfR0 J7zQ== X-Gm-Message-State: ALoCoQlrj2BG+fLYeEPq+WePcG86lMguSVHW/68Ec8g1Hr0iqyOcFio2yueE7f1gwnTTjRvDP37M X-Received: by 10.236.198.197 with SMTP id v45mr5026817yhn.26.1379077874175; Fri, 13 Sep 2013 06:11:14 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.164 with SMTP id ll4ls1074364qeb.17.gmail; Fri, 13 Sep 2013 06:11:13 -0700 (PDT) X-Received: by 10.58.100.234 with SMTP id fb10mr12094299veb.5.1379077873925; Fri, 13 Sep 2013 06:11:13 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id ee8si3102024vdc.54.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:11:13 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id m17so919051vca.3 for ; Fri, 13 Sep 2013 06:11:13 -0700 (PDT) X-Received: by 10.52.103.35 with SMTP id ft3mr10209679vdb.5.1379077873793; Fri, 13 Sep 2013 06:11:13 -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 u4csp79856vcz; Fri, 13 Sep 2013 06:11:13 -0700 (PDT) X-Received: by 10.66.156.229 with SMTP id wh5mr15195890pab.156.1379077872831; Fri, 13 Sep 2013 06:11:12 -0700 (PDT) Received: from mail-pb0-f49.google.com (mail-pb0-f49.google.com [209.85.160.49]) by mx.google.com with ESMTPS id iv2si11156020pac.235.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:11:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.49 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.160.49; Received: by mail-pb0-f49.google.com with SMTP id xb4so1207225pbc.8 for ; Fri, 13 Sep 2013 06:11:12 -0700 (PDT) X-Received: by 10.68.255.69 with SMTP id ao5mr13475914pbd.66.1379077872360; Fri, 13 Sep 2013 06:11:12 -0700 (PDT) Received: from localhost ([122.167.78.148]) by mx.google.com with ESMTPSA id tg7sm11666971pbc.36.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 13 Sep 2013 06:11:11 -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 , Andrew Lunn Subject: [PATCH 069/228] cpufreq: kirkwood: Use generic cpufreq routines Date: Fri, 13 Sep 2013 18:30:15 +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.172 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 Tested-by: Andrew Lunn --- 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 59cbb35..1a4e4f4 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)