From patchwork Tue Aug 13 13:32: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: 2843752 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B25C29F294 for ; Tue, 13 Aug 2013 15:13:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D72252050E for ; Tue, 13 Aug 2013 15:13:42 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00DA6204FC for ; Tue, 13 Aug 2013 15:13:41 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9Emk-0008Sh-5f; Tue, 13 Aug 2013 13:37:18 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9EmN-0008A8-Ad; Tue, 13 Aug 2013 13:36:55 +0000 Received: from mail-pb0-f54.google.com ([209.85.160.54]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1V9El9-0007to-14 for linux-arm-kernel@lists.infradead.org; Tue, 13 Aug 2013 13:35:39 +0000 Received: by mail-pb0-f54.google.com with SMTP id ro12so7998612pbb.13 for ; Tue, 13 Aug 2013 06:35:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=N9dR2LeU54t4ZYAZk1UaXBcOQVHhcFvnCBqIijhvSCM=; b=mDtk88u6HBZD7QQu/Nj5AYFFJ4uUpuYd0jNdCFr1Igm8QJfwWGv/ns6RoGcu2cTQGW sICQ7rWxuneSSjH+yEwh3CbkLctvRJfjPdMb9xLg6FTJPt3PEBTILThuStRrk0tEwDyV bVpumGsTfcTTZVnValjfYylk/k25WdhK0/w5KEixT+dToL+Fz5L2io9ypYkBUX0uCLgP FeDRUUzeYEQveQUvz4kHUfBREhPDES3oS7h2kJKhtjLbz/5wbH45VHd5dPHE/hH5uy52 NHYi3iwIpksla+tomiMqATzEWGcQhfoKFQ6qV/S6ZJXotDPiHUu3ndSIh1B8ZatAnk1G ugSw== X-Gm-Message-State: ALoCoQlCqLYFsc81JnybARgNy3B3CTzQ8HZDxwOdUzeVmxNJzNkDUoQMSRKfygbraKovBQ6wwKNe X-Received: by 10.67.11.103 with SMTP id eh7mr4659568pad.153.1376400916710; Tue, 13 Aug 2013 06:35:16 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id qh10sm43979061pbb.33.2013.08.13.06.35.12 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:35:16 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Subject: [PATCH V2 17/35] cpufreq: longhaul: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:30 +0530 Message-Id: <65691d6e5ef6f37f54774a5f33c30cbe43bed042.1376392602.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-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130813_093539_174406_A2AA0AF6 X-CRM114-Status: GOOD ( 11.66 ) X-Spam-Score: -2.6 (--) Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, Viresh Kumar , patches@linaro.org, linux-kernel@vger.kernel.org, cpufreq@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 This patch converts existing .target() to newly defined light weight .target_index() routine for this driver. CPUFreq core will call cpufreq_frequency_table_target() before calling this routine and will pass index to it. Signed-off-by: Viresh Kumar --- drivers/cpufreq/longhaul.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/cpufreq/longhaul.c b/drivers/cpufreq/longhaul.c index 57d7b02..e566776 100644 --- a/drivers/cpufreq/longhaul.c +++ b/drivers/cpufreq/longhaul.c @@ -626,21 +626,12 @@ static void longhaul_setup_voltagescaling(void) static int longhaul_target(struct cpufreq_policy *policy, - unsigned int target_freq, unsigned int relation) + unsigned int table_index) { - unsigned int table_index = 0; unsigned int i; unsigned int dir = 0; u8 vid, current_vid; - if (cpufreq_frequency_table_target(policy, longhaul_table, target_freq, - relation, &table_index)) - return -EINVAL; - - /* Don't set same frequency again */ - if (longhaul_index == table_index) - return 0; - if (!can_scale_voltage) longhaul_setstate(policy, table_index); else { @@ -920,7 +911,7 @@ static int longhaul_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver longhaul_driver = { .verify = cpufreq_generic_frequency_table_verify, - .target = longhaul_target, + .target_index = longhaul_target, .get = longhaul_get, .init = longhaul_cpu_init, .exit = cpufreq_generic_exit,