From patchwork Fri Oct 18 13:59:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 21161 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f72.google.com (mail-pb0-f72.google.com [209.85.160.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B00AC202FF for ; Fri, 18 Oct 2013 14:04:02 +0000 (UTC) Received: by mail-pb0-f72.google.com with SMTP id rq2sf5903303pbb.3 for ; Fri, 18 Oct 2013 07:04:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=afMuNPCtF7hw3TbQj2LSptShu48oYduWexV3iafS0Cc=; b=mhSt0ioB3Au50K84LUKG8w6Ou7Wyc0BPtNYMHe2JWkmEg9PrIYmItSBE98/YOxCWL4 K9hueirQOSjyCepa7vIq+NK3rin9F1xb4W2rIZvObUlKeQF8+VMj8Wk0BvcaMvMnOx54 F+avmh7x4LCq7eLnjXwWYUpPHm6yCPXusQZ08o9KB3hry+99dJ2kbEf9iJ1jpbAJFNWV uzFLlqewYuUmcH1/L6Re9gLXtrne7M3sZxekVp4eM4etr2KHmbgO816wq90m3Mxher/Y Nig4/aV6v829MFh7uVIfx1WOFNQEW6JE3+CReUNZziw0vR+Vm6/wvGfLM947kdx1Erqw kHYQ== X-Received: by 10.68.162.65 with SMTP id xy1mr1152144pbb.2.1382105042056; Fri, 18 Oct 2013 07:04:02 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.2.166 with SMTP id 6ls1308858qev.69.gmail; Fri, 18 Oct 2013 07:04:01 -0700 (PDT) X-Received: by 10.52.33.44 with SMTP id o12mr1866256vdi.7.1382105041920; Fri, 18 Oct 2013 07:04:01 -0700 (PDT) Received: from mail-vb0-f44.google.com (mail-vb0-f44.google.com [209.85.212.44]) by mx.google.com with ESMTPS id sw5si339938veb.23.2013.10.18.07.04.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:04:01 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.44 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.44; Received: by mail-vb0-f44.google.com with SMTP id 11so238696vbe.31 for ; Fri, 18 Oct 2013 07:04:01 -0700 (PDT) X-Gm-Message-State: ALoCoQm0vjXw1d75oGJ2MtFM+Pd7ByWmjfhbAJnxYXnTey76JvUzIO7fTT/MBPihRzohKtwI0Uuc X-Received: by 10.58.44.197 with SMTP id g5mr2209369vem.0.1382105041827; Fri, 18 Oct 2013 07:04:01 -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 u4csp38173vcz; Fri, 18 Oct 2013 07:04:01 -0700 (PDT) X-Received: by 10.68.14.200 with SMTP id r8mr3283590pbc.52.1382105040613; Fri, 18 Oct 2013 07:04:00 -0700 (PDT) Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by mx.google.com with ESMTPS id mj9si1592049pab.74.2013.10.18.07.04.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:04:00 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.181 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.181; Received: by mail-pd0-f181.google.com with SMTP id y13so4702955pdi.40 for ; Fri, 18 Oct 2013 07:04:00 -0700 (PDT) X-Received: by 10.68.253.1 with SMTP id zw1mr3311605pbc.30.1382105040197; Fri, 18 Oct 2013 07:04:00 -0700 (PDT) Received: from localhost ([120.56.197.189]) by mx.google.com with ESMTPSA id v4sm2618385pbq.31.2013.10.18.07.03.56 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 18 Oct 2013 07:03:59 -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 Subject: [PATCH V2 Resend 30/34] cpufreq: sc520: Convert to light weight ->target_index() routine Date: Fri, 18 Oct 2013 19:29:53 +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.212.44 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: , 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/sc520_freq.c | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/drivers/cpufreq/sc520_freq.c b/drivers/cpufreq/sc520_freq.c index 9047ab1..6c86452 100644 --- a/drivers/cpufreq/sc520_freq.c +++ b/drivers/cpufreq/sc520_freq.c @@ -53,8 +53,7 @@ static unsigned int sc520_freq_get_cpu_frequency(unsigned int cpu) } } -static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy, - unsigned int state) +static int sc520_freq_target(struct cpufreq_policy *policy, unsigned int state) { struct cpufreq_freqs freqs; @@ -76,24 +75,10 @@ static void sc520_freq_set_cpu_state(struct cpufreq_policy *policy, local_irq_enable(); cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); -}; - -static int sc520_freq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) -{ - unsigned int newstate = 0; - - if (cpufreq_frequency_table_target(policy, sc520_freq_table, - target_freq, relation, &newstate)) - return -EINVAL; - - sc520_freq_set_cpu_state(policy, newstate); return 0; } - /* * Module init and exit code */ @@ -117,7 +102,7 @@ static int sc520_freq_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver sc520_freq_driver = { .get = sc520_freq_get_cpu_frequency, .verify = cpufreq_generic_frequency_table_verify, - .target = sc520_freq_target, + .target_index = sc520_freq_target, .init = sc520_freq_cpu_init, .exit = cpufreq_generic_exit, .name = "sc520_freq",