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: 2330321 Return-Path: X-Original-To: patchwork-linux-sh@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 D56A53FC54 for ; Mon, 25 Mar 2013 10:24:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753440Ab3CYKYQ (ORCPT ); Mon, 25 Mar 2013 06:24:16 -0400 Received: from mail-oa0-f51.google.com ([209.85.219.51]:52572 "EHLO mail-oa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754294Ab3CYKYO (ORCPT ); Mon, 25 Mar 2013 06:24:14 -0400 Received: by mail-oa0-f51.google.com with SMTP id g12so2845270oah.38 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=Y+ZscAtwkS/w4EBPkor5m5S+a9vD1I3MknLixC57XJG3sqhPIKakCEccUUCkoID68R QEmSnyF1vRwjss4C3V3u62qCfmpO+3lO3JEbAf2pH5tKttqWGcYAUq8r7/E5g/2O+smM Ib5OPxaBrxyQKcJSyb3/OMpcWpajboCazZz33N09jFOvtNJG1Qa2N6vZVxnU7ojBc+Xw uQemYEkpFuvVMenqhAKhxMuy8YTyzr6rMfooMaB+IVODSE22aMMLM2/R2A+4ryD/lW16 HWZFYyTrDGbYcL33+yRJ9FkLQ1tJ/pUzGqBMlFVuJ9Lv5h1hua2qt+b2JYNqwFIWr1qT hdKQ== 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: ALoCoQmplR2w1Xb6MfUda9wuFM5groOq4YQ7mcRsAGcV5/WDbiQxvPyU/ctZpkY7rn7Sqg9E5sVk Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@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.