From patchwork Mon Mar 25 10:24:13 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 2330341 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 80EEBDF24C for ; Mon, 25 Mar 2013 10:24:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754294Ab3CYKYQ (ORCPT ); Mon, 25 Mar 2013 06:24:16 -0400 Received: from mail-ob0-f172.google.com ([209.85.214.172]:63060 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754794Ab3CYKYO (ORCPT ); Mon, 25 Mar 2013 06:24:14 -0400 Received: by mail-ob0-f172.google.com with SMTP id tb18so5785565obb.17 for ; Mon, 25 Mar 2013 03:24:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type:x-gm-message-state; bh=IsL3zBMlC8KA3qfvlp7OiGI4wb0lLPseUd3yVe7M3S4=; b=luLCFgWWNfh9+c+tCp36W9N+BlA5/8xld3L4zO0X0+cNnHzL4u+EQFQN4UiciXZs8+ NLgsRa5sYSEP0ohBn/6Jl9GfmC8YXyUUiyTGyQWx78ArE/8GE8yz1CeOExyQeqeQ8BaQ lZzfpKR8EImHej0dNvajrEV5CBTY2Y4JaQRSCQfwTuAw5err1bM04fsmYCAYNh/zmDXS BhF32oxCAtKvZqEvhDIn52j6ptEKecwFqjW4Nl2jEOxxqN6QWginaqCx4kd1pNPIXo22 TnaB6vjOIRSxtCJcZuBJHQFDdG4F3dtpakDuzGkGKGnqRPjdKT2iYc9AkymIkI1UeeE2 so1g== MIME-Version: 1.0 X-Received: by 10.60.20.193 with SMTP id p1mr10913601oee.133.1364207054075; Mon, 25 Mar 2013 03:24:14 -0700 (PDT) Received: by 10.182.52.198 with HTTP; Mon, 25 Mar 2013 03:24:13 -0700 (PDT) In-Reply-To: <51501BD5.2070807@ti.com> References: <2ece6d9fe8dfb6882a1c83a1cb2404bacc40b22d.1364138740.git.viresh.kumar@linaro.org> <07b96c5b68470001197445fb3d28786ad9acdbe0.1364138740.git.viresh.kumar@linaro.org> <51500C81.7040307@ti.com> <51501BD5.2070807@ti.com> Date: Mon, 25 Mar 2013 15:54:13 +0530 Message-ID: Subject: Re: [PATCH 2/2] cpufreq: drivers: Remove unnecessary assignments of policy-> members From: Viresh Kumar To: Sekhar Nori Cc: rjw@sisk.pl, 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, Sascha Hauer , Paul Mundt , linux-sh@vger.kernel.org, linux-omap@vger.kernel.org X-Gm-Message-State: ALoCoQkp+Ae2fNVEcfbqJPCrX41nobJERO0AnCEz72Ee5W0yZqluUn1Zct+xAvSMg0Cf/2Cb0flO Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On 25 March 2013 15:11, Sekhar Nori wrote: > So down in the cpufreq driver probe below, we bail out if freq_table is > not provided. So all this checking for freq_table in the code you pasted > above is superfluous. If you can clean that part up and add checking for > cpufreq_frequency_table_cpuinfo() as you proposed, I will be glad to > test it out ;) Attached is the complete patch and following is your fixup for davinci (just to review): Acked-by: Sekhar Nori diff --git a/arch/arm/mach-davinci/cpufreq.c b/arch/arm/mach-davinci/cpufreq.c index ff46862..7c2e943 100644 --- a/arch/arm/mach-davinci/cpufreq.c +++ b/arch/arm/mach-davinci/cpufreq.c @@ -137,18 +137,17 @@ static int davinci_cpu_init(struct cpufreq_policy *policy) return result; } - policy->cur = policy->min = policy->max = davinci_getspeed(0); - - if (freq_table) { - result = cpufreq_frequency_table_cpuinfo(policy, freq_table); - if (!result) - cpufreq_frequency_table_get_attr(freq_table, - policy->cpu); - } else { - policy->cpuinfo.min_freq = policy->min; - policy->cpuinfo.max_freq = policy->max; + policy->cur = davinci_getspeed(0); + + result = cpufreq_frequency_table_cpuinfo(policy, freq_table); + if (result) { + pr_err("%s: cpufreq_frequency_table_cpuinfo() failed", + __func__); + return result; } + cpufreq_frequency_table_get_attr(freq_table, policy->cpu); + /* * Time measurement across the target() function yields ~1500-1800us * time taken with no drivers on notification list.