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: 2330351 Return-Path: X-Original-To: patchwork-linux-omap@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 B0342E014A for ; Mon, 25 Mar 2013 10:24:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756625Ab3CYKYQ (ORCPT ); Mon, 25 Mar 2013 06:24:16 -0400 Received: from mail-oa0-f48.google.com ([209.85.219.48]:50619 "EHLO mail-oa0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753440Ab3CYKYO (ORCPT ); Mon, 25 Mar 2013 06:24:14 -0400 Received: by mail-oa0-f48.google.com with SMTP id j1so6079231oag.7 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=F/zzQYpkttSCe0Igfi6V47rgGD2cKgY2CkVOOPy11eESeSHdQYp8z5AYG6VZfHNBzb 4dGqqa1e5D23x3natTFdfVE7hAz6PeChGLSTdwOU09KkRltwszyIMKVxydIaEG46BAaA g5DSwZDHCAcwEhNc4nCWm2RtH1xyTZkAig7se98MRvMxqrp6gsTtqtCgYGMinZwFjU6E LZNVfZT91Ua6WFHLn9nrugiiJXkEYn2hL3yewg8dDUtmcEXX6nZ3ZVIpWP+WGkJthLx9 bF5lsR75v7fJPQQZy4dxqyUEhFGG0mWC6l1HtoQd6To3eiLjwppnx2MYhsGdcUQncoaI b+mg== 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: ALoCoQkEl1DKMj8HKqEMBbQ1PXSazLIFPiSJY9LHBDGvq6d7pTcIRzUiteug81k9s5WOEqPm/zL+ Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@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.