From patchwork Tue Aug 13 13:32:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19086 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 76F61246B8 for ; Tue, 13 Aug 2013 13:37:04 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf1463047vcb.11 for ; Tue, 13 Aug 2013 06:37:04 -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=UQfr+3rNVzUYuKEPYabjkcyWDim0A5gnNebDzxoz2LU=; b=nB637lSqXAQFhZTmCYWEJMJqGTkLMFSYrXSuHfEtquiKCLpmtV1oGaFr1zWVxSWEF/ YxaiKVUcm7qeU48nUqb3AH17CJdU26Qi+d4ecBZYgdfNbwLvBcUPDYDQ5+Yka/Ldej1d DpP65lneUZg9G9PTN8Q5wfrgL+qzAxfjaVuc0l/w+C1ZrzfAY5h3lwo6jRYIX3JlMnEV azf53+4rqJUBT0OfxUckQbq68Iw9QiU4vbW4RG7oTfPO8/MifUA8duJIzuByjc+RNvQX SyCDZpUXDGWR3mj+yuu3yp4rG6Q5Ni4Aoirshxl5ov5tlFg0YW2h93ki6jSDXazFXQmw BZkw== X-Received: by 10.236.135.66 with SMTP id t42mr1659182yhi.36.1376401024194; Tue, 13 Aug 2013 06:37:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.81.179 with SMTP id b19ls2739878qey.31.gmail; Tue, 13 Aug 2013 06:37:04 -0700 (PDT) X-Received: by 10.52.35.98 with SMTP id g2mr3793422vdj.0.1376401023988; Tue, 13 Aug 2013 06:37:03 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id r3si9749316vcf.65.2013.08.13.06.37.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:37:03 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.179 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id c13so6640685vea.24 for ; Tue, 13 Aug 2013 06:37:03 -0700 (PDT) X-Gm-Message-State: ALoCoQlwxtbRuyl5pILCU+cmcEORnBWyJDsu8HZMDIAypIHTsxEnG9gyZxJvJn8ThqLyVL+fltQN X-Received: by 10.52.89.197 with SMTP id bq5mr90091vdb.65.1376401023908; Tue, 13 Aug 2013 06:37:03 -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 u4csp154304vcz; Tue, 13 Aug 2013 06:37:03 -0700 (PDT) X-Received: by 10.68.210.103 with SMTP id mt7mr2106662pbc.179.1376401022937; Tue, 13 Aug 2013 06:37:02 -0700 (PDT) Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by mx.google.com with ESMTPS id i3si26264667pac.103.2013.08.13.06.37.02 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:37:02 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.176 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.192.176; Received: by mail-pd0-f176.google.com with SMTP id q10so4896525pdj.21 for ; Tue, 13 Aug 2013 06:37:02 -0700 (PDT) X-Received: by 10.68.220.1 with SMTP id ps1mr4625326pbc.30.1376401022445; Tue, 13 Aug 2013 06:37:02 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id pq1sm43998266pbb.26.2013.08.13.06.36.58 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 13 Aug 2013 06:37:01 -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 Subject: [PATCH V2 31/35] cpufreq: sc520: Covert to light weight ->target_index() routine Date: Tue, 13 Aug 2013 19:02:44 +0530 Message-Id: <6d9dbb87bae62a0f387d1528065dea6db1d21fdd.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-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.128.179 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 8556225..cd62472 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 */ @@ -118,7 +103,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",