From patchwork Sun Mar 24 15:29:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2326761 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A955D3FDDA for ; Sun, 24 Mar 2013 15:29:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753778Ab3CXP36 (ORCPT ); Sun, 24 Mar 2013 11:29:58 -0400 Received: from mail-pa0-f41.google.com ([209.85.220.41]:57721 "EHLO mail-pa0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753408Ab3CXP36 (ORCPT ); Sun, 24 Mar 2013 11:29:58 -0400 Received: by mail-pa0-f41.google.com with SMTP id kx1so169336pab.28 for ; Sun, 24 Mar 2013 08:29:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=STk3nxeeQBBrV15xQyWvELjhWti08Z0kz975AaIMuCg=; b=Nhocf6NrSfP8CLih4B8p5fL+8vdsDuVhlqHCV63e/MW4wT3X6tgn9sCRpijWmk/012 2xBunF6qbXjWs8thiI0LheftbvPTdkdchxJYK9QQ3E9oteW8DdRdoFYnz412VGpoFBfk VxzrW6b9tRZFxKpOH7Lf4+n7lBffJDQGJeGx3r2KoRBtDibS3us61cEcf9ybPbeoUAKg okEhye2l1S/FYw2TuCq3q0RugX8BUxffuE7tTgh+rpff2JxkKsxvNkS5Ym1dz2WeIHK4 1TGdcWYY9BINNjoYvzuZIDS70NVyT/qIOFXzR9ffp4FHtjlDPYhPG0gLKKoWzDHkkENv InZg== X-Received: by 10.66.220.197 with SMTP id py5mr13572470pac.86.1364138997579; Sun, 24 Mar 2013 08:29:57 -0700 (PDT) Received: from localhost ([122.166.179.164]) by mx.google.com with ESMTPS id yr10sm11118345pab.6.2013.03.24.08.29.52 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 24 Mar 2013 08:29:56 -0700 (PDT) From: Viresh Kumar To: rjw@sisk.pl Cc: arvind.chauhan@arm.com, robin.randhawa@arm.com, Steve.Bannister@arm.com, Liviu.Dudau@arm.com, charles.garcia-tobin@arm.com, cpufreq@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org, Viresh Kumar , Sekhar Nori , Linus Walleij Subject: [PATCH 1/2] cpufreq: drivers: don't check range of target freq in .target() Date: Sun, 24 Mar 2013 20:59:42 +0530 Message-Id: <2ece6d9fe8dfb6882a1c83a1cb2404bacc40b22d.1364138740.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 1.7.12.rc2.18.g61b472e X-Gm-Message-State: ALoCoQkVCF7xQIyqHkeTfI2U8i5RPeMyqKG+pO7Ek1Tu9rN2Lk05mfEZBhkPHRoJ546bTm5KElA8 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Cpufreq core checks the range of target_freq before calling driver->target() and so we don't need to do it again. Remove it. Cc: Sekhar Nori Cc: Linus Walleij Signed-off-by: Viresh Kumar Acked-by: Linus Walleij --- arch/arm/mach-davinci/cpufreq.c | 9 --------- drivers/cpufreq/dbx500-cpufreq.c | 6 ------ 2 files changed, 15 deletions(-) diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c index 55eb870..8fb0c2a 100644 --- a/arch/arm/mach-davinci/cpufreq.c +++ b/arch/arm/mach-davinci/cpufreq.c @@ -79,15 +79,6 @@ static int davinci_target(struct cpufreq_policy *policy, struct davinci_cpufreq_config *pdata = cpufreq.dev->platform_data; struct clk *armclk = cpufreq.armclk; - /* - * Ensure desired rate is within allowed range. Some govenors - * (ondemand) will just pass target_freq=0 to get the minimum. - */ - if (target_freq < policy->cpuinfo.min_freq) - target_freq = policy->cpuinfo.min_freq; - if (target_freq > policy->cpuinfo.max_freq) - target_freq = policy->cpuinfo.max_freq; - freqs.old = davinci_getspeed(0); freqs.new = clk_round_rate(armclk, target_freq * 1000) / 1000; diff --git a/drivers/cpufreq/dbx500-cpufreq.c b/drivers/cpufreq/dbx500-cpufreq.c index 7192a6d..15ed367 100644 --- a/drivers/cpufreq/dbx500-cpufreq.c +++ b/drivers/cpufreq/dbx500-cpufreq.c @@ -37,12 +37,6 @@ static int dbx500_cpufreq_target(struct cpufreq_policy *policy, unsigned int idx; int ret; - /* scale the target frequency to one of the extremes supported */ - if (target_freq < policy->cpuinfo.min_freq) - target_freq = policy->cpuinfo.min_freq; - if (target_freq > policy->cpuinfo.max_freq) - target_freq = policy->cpuinfo.max_freq; - /* Lookup the next frequency */ if (cpufreq_frequency_table_target(policy, freq_table, target_freq, relation, &idx))