From patchwork Thu Oct 3 14:58:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2983211 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 8D254BFF0B for ; Thu, 3 Oct 2013 15:00:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 045E420150 for ; Thu, 3 Oct 2013 15:00:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D1BCC20373 for ; Thu, 3 Oct 2013 15:00:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754687Ab3JCPAt (ORCPT ); Thu, 3 Oct 2013 11:00:49 -0400 Received: from mail-pb0-f51.google.com ([209.85.160.51]:56759 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754120Ab3JCPAs (ORCPT ); Thu, 3 Oct 2013 11:00:48 -0400 Received: by mail-pb0-f51.google.com with SMTP id jt11so2663538pbb.10 for ; Thu, 03 Oct 2013 08:00:48 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=U4B7ROFbnIisArqnlDjEd1Rv45WcM8RRimWlhsDbYQs=; b=l6I9joVt7vifa08R3B1Ybp3bQ4SOZUp5sAgykWTpRWk2mbC+kRDlbvufHv6YD4Av5g 9MRGTovnsRLgzCjOkU9+UehOO9HxbJGlVcPqdkoGgAYOv333prw6xGE9j+wUDwOmeajz kmeSxUSoSZ2/Z41g5lR9WfeYfVkrpSTP7GnVeqvMg8FYoMJfuqMUXeA5LR/aUrpaDW+G eHVmZxYCBtEhr8rTPEI2YDDlxkC3+hNUFcorghokPSQMkpPC7TSH18rESYE+EEh+ncK/ t+jsiogdbFBTr5489mCjh9vy76irsItTvDkz4paRbk4Vua4IK3o0XH+Y2RRIYwOI92hj Lqsw== X-Gm-Message-State: ALoCoQkHWVhBd7hpXDz3TOv3qlUZK/9r5c8HORN5F32j6vvdQr5Hn0d1aD2qXVPKm7EMyGflbx98 X-Received: by 10.68.113.99 with SMTP id ix3mr951617pbb.180.1380812447977; Thu, 03 Oct 2013 08:00:47 -0700 (PDT) Received: from localhost ([122.167.152.64]) by mx.google.com with ESMTPSA id o1sm8746452pbe.37.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 03 Oct 2013 08:00:47 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, Viresh Kumar Subject: [PATCH V2 Resend 10/92] cpufreq: e_powersaver: Use generic cpufreq routines Date: Thu, 3 Oct 2013 20:28:04 +0530 Message-Id: X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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/e_powersaver.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/cpufreq/e_powersaver.c b/drivers/cpufreq/e_powersaver.c index c1b7c99..a8cbbd0 100644 --- a/drivers/cpufreq/e_powersaver.c +++ b/drivers/cpufreq/e_powersaver.c @@ -198,12 +198,6 @@ static int eps_target(struct cpufreq_policy *policy, return ret; } -static int eps_verify(struct cpufreq_policy *policy) -{ - return cpufreq_frequency_table_verify(policy, - &eps_cpu[policy->cpu]->freq_table[0]); -} - static int eps_cpu_init(struct cpufreq_policy *policy) { unsigned int i; @@ -423,19 +417,14 @@ static int eps_cpu_exit(struct cpufreq_policy *policy) return 0; } -static struct freq_attr *eps_attr[] = { - &cpufreq_freq_attr_scaling_available_freqs, - NULL, -}; - static struct cpufreq_driver eps_driver = { - .verify = eps_verify, + .verify = cpufreq_generic_frequency_table_verify, .target = eps_target, .init = eps_cpu_init, .exit = eps_cpu_exit, .get = eps_get, .name = "e_powersaver", - .attr = eps_attr, + .attr = cpufreq_generic_attr, };