From patchwork Mon Aug 12 17:48:51 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 19025 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 E2113246B8 for ; Mon, 12 Aug 2013 17:51:20 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf468924vcb.11 for ; Mon, 12 Aug 2013 10:51:20 -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=Tpbfiu0KPnhEKBgJ2Xsdg8axDAwkgPZLV7lkvj9JuZs=; b=ff5l6boTMRBEb1+a4G99x/XJSlcg7PpBkzqzlayC7KZd3yxgcp/1a1eEnX7Bs03+9g sSvfjkPNe8QVWmxXqSQRL8f4MI31UDFAhjqwIjo89UWrlGcwCBSAl0Co/WbfEwakQHNQ GpihBCg8iGCQ9CWc33dSXp6lPQyXuOJ0m69JAhXv+RazicfHADmwbx7/DJXCJoYANtG3 WRZKq1o1LLqYF4Lr7M7K9cZVs4V4CLSRcVIZo6FhC8q9fUja5ct3kTPFMH190qxXGxEI d2VixgoYJfpoJ3ongTKDIAeHggFhgZ9mTciuQa6C8lY/JoUJAD/DmLG0nbYRdKRP1UVY N+tA== X-Received: by 10.236.109.199 with SMTP id s47mr80857yhg.2.1376329880524; Mon, 12 Aug 2013 10:51:20 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.26.234 with SMTP id o10ls2219374qeg.27.gmail; Mon, 12 Aug 2013 10:51:20 -0700 (PDT) X-Received: by 10.221.39.134 with SMTP id tm6mr156050vcb.10.1376329880387; Mon, 12 Aug 2013 10:51:20 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id n6si8584094ven.117.2013.08.12.10.51.20 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 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.177; Received: by mail-vc0-f177.google.com with SMTP id gf12so2987776vcb.8 for ; Mon, 12 Aug 2013 10:51:20 -0700 (PDT) X-Gm-Message-State: ALoCoQnHpifzVzwbPlUp5SY4W8p1Fc5o0qgDCXeVW9ueXhzmkZmnVyTnkYTQF8l9cQnLR1m7N10b X-Received: by 10.220.84.65 with SMTP id i1mr146122vcl.51.1376329880299; Mon, 12 Aug 2013 10:51:20 -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 u4csp108231vcz; Mon, 12 Aug 2013 10:51:19 -0700 (PDT) X-Received: by 10.66.233.195 with SMTP id ty3mr249188pac.70.1376329879428; Mon, 12 Aug 2013 10:51:19 -0700 (PDT) Received: from mail-pa0-f45.google.com (mail-pa0-f45.google.com [209.85.220.45]) by mx.google.com with ESMTPS id fa5si4995808pab.100.2013.08.12.10.51.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:19 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.45 is neither permitted nor denied by best guess record for domain of viresh.kumar@linaro.org) client-ip=209.85.220.45; Received: by mail-pa0-f45.google.com with SMTP id bg4so7817022pad.32 for ; Mon, 12 Aug 2013 10:51:19 -0700 (PDT) X-Received: by 10.68.90.130 with SMTP id bw2mr243615pbb.89.1376329879043; Mon, 12 Aug 2013 10:51:19 -0700 (PDT) Received: from localhost ([122.172.193.46]) by mx.google.com with ESMTPSA id vz4sm4940839pab.11.2013.08.12.10.51.15 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 12 Aug 2013 10:51:18 -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 , Andrew Lunn Subject: [PATCH 15/31] cpufreq: kirkwood: Covert to light weight ->target() routine Date: Mon, 12 Aug 2013 23:18:51 +0530 Message-Id: <988373350842566f5c27734a65f6b0697fc16418.1376329128.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.220.177 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_old() to newly defined light weight .target() routine for this driver. CPUFreq core will call cpufreq_frequency_table_target() before calling this routine and will pass index to it. Cc: Andrew Lunn Signed-off-by: Viresh Kumar --- drivers/cpufreq/kirkwood-cpufreq.c | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-cpufreq.c index 6360612..dddf23c 100644 --- a/drivers/cpufreq/kirkwood-cpufreq.c +++ b/drivers/cpufreq/kirkwood-cpufreq.c @@ -55,8 +55,8 @@ static unsigned int kirkwood_cpufreq_get_cpu_frequency(unsigned int cpu) return kirkwood_freq_table[0].frequency; } -static void kirkwood_cpufreq_set_cpu_state(struct cpufreq_policy *policy, - unsigned int index) +static int kirkwood_cpufreq_target(struct cpufreq_policy *policy, + unsigned int index) { struct cpufreq_freqs freqs; unsigned int state = kirkwood_freq_table[index].driver_data; @@ -100,19 +100,6 @@ static void kirkwood_cpufreq_set_cpu_state(struct cpufreq_policy *policy, local_irq_enable(); } cpufreq_notify_transition(policy, &freqs, CPUFREQ_POSTCHANGE); -}; - -static int kirkwood_cpufreq_target(struct cpufreq_policy *policy, - unsigned int target_freq, - unsigned int relation) -{ - unsigned int index = 0; - - if (cpufreq_frequency_table_target(policy, kirkwood_freq_table, - target_freq, relation, &index)) - return -EINVAL; - - kirkwood_cpufreq_set_cpu_state(policy, index); return 0; } @@ -130,7 +117,7 @@ static int kirkwood_cpufreq_cpu_init(struct cpufreq_policy *policy) static struct cpufreq_driver kirkwood_cpufreq_driver = { .get = kirkwood_cpufreq_get_cpu_frequency, .verify = cpufreq_generic_frequency_table_verify, - .target_old = kirkwood_cpufreq_target, + .target = kirkwood_cpufreq_target, .init = kirkwood_cpufreq_cpu_init, .exit = cpufreq_generic_exit, .name = "kirkwood-cpufreq",