From patchwork Mon Feb 26 05:09:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10241265 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A11C260208 for ; Mon, 26 Feb 2018 05:10:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 93532292DF for ; Mon, 26 Feb 2018 05:10:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 88629297C3; Mon, 26 Feb 2018 05:10:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01AD0292DF for ; Mon, 26 Feb 2018 05:10:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751967AbeBZFKS (ORCPT ); Mon, 26 Feb 2018 00:10:18 -0500 Received: from mail-pl0-f65.google.com ([209.85.160.65]:44279 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbeBZFKR (ORCPT ); Mon, 26 Feb 2018 00:10:17 -0500 Received: by mail-pl0-f65.google.com with SMTP id w21so8654595plp.11 for ; Sun, 25 Feb 2018 21:10:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=qh/+GpEvGyuW/Zspx9kpe7jf9gBjpRlz09+U9WjLNu8=; b=dhfxHY5REkPRrCG4WD1cRaFTzPFvWoOOSmD4QM24CQgMn54cph/JcpP5IKFKN6NySh Ve42rJpPVT/X0S4P4TB21fsVc7VVsQ7rvdGLEs+yG5DHzC2dO6leblBpTh7oj+eOz+SO 3dQ+AMI6pKsV2UkBemQN4GBYlX7nJEjQdarAc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=qh/+GpEvGyuW/Zspx9kpe7jf9gBjpRlz09+U9WjLNu8=; b=pwBPATAIqbxo2LN/MIOIyJDr4Hftzsh2Toj8SV3OsULo/Mu+gUi5lhBr4joVsg0nXi j4WUNW98Qf1xvuGjUBP5fzBSsey8VlBASktjsn0aLHxSK0bfPamh9HLbHm0ytlQa8ibN iXPGLnR78hLsgas0k4Y0eDeewxCgs/ktgjt3al0lHZ9/XzLy0hClaCCILWCufiMrrSpU Y+3DLboaEtfzU2i/pB50jEj7RRaSoShtzeRTs4S9ZRamWXKJB5UcrpZ4Tfm7kqfktY38 bltpYpSokjHgQEfdpS52wpcPiodOJGeiCJnhJV+g1F/sor01XTe9e3+l5wZptXUwlD+N DpUg== X-Gm-Message-State: APf1xPDEJC6j47H0mpyYgB2d9UCE7hyQ2uA77Cfea8DCcXBaPjbXVz+Y YnFpfgb4nTLaJx59nIPcYQEO3A== X-Google-Smtp-Source: AH8x22607o0PCVu8SUqpn52EbfPw/mCrY+pk3W7FMw9ZQQpuli1raAqG+DiKMFMYIrlQ85O0v0u8AQ== X-Received: by 2002:a17:902:ba84:: with SMTP id k4-v6mr9320424pls.116.1519621817400; Sun, 25 Feb 2018 21:10:17 -0800 (PST) Received: from localhost ([122.172.92.38]) by smtp.gmail.com with ESMTPSA id x26sm14520757pfi.141.2018.02.25.21.10.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Feb 2018 21:10:16 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot Subject: [PATCH 18/27] cpufreq: qoirq: Don't validate the frequency table twice Date: Mon, 26 Feb 2018 10:39:01 +0530 Message-Id: X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The cpufreq core is already validating the CPU frequency table after calling the ->init() callback of the cpufreq drivers and the drivers don't need to do the same anymore. Though they need to set the policy->freq_table field directly from the ->init() callback now. Stop validating the frequency table from qoirq driver. Signed-off-by: Viresh Kumar --- drivers/cpufreq/qoriq-cpufreq.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/cpufreq/qoriq-cpufreq.c b/drivers/cpufreq/qoriq-cpufreq.c index 0562761a3dec..ba533e9c6b11 100644 --- a/drivers/cpufreq/qoriq-cpufreq.c +++ b/drivers/cpufreq/qoriq-cpufreq.c @@ -165,7 +165,7 @@ static void freq_table_sort(struct cpufreq_frequency_table *freq_table, static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy) { struct device_node *np; - int i, count, ret; + int i, count; u32 freq; struct clk *clk; const struct clk_hw *hwclk; @@ -213,14 +213,7 @@ static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy) freq_table_redup(table, count); freq_table_sort(table, count); table[i].frequency = CPUFREQ_TABLE_END; - - /* set the min and max frequency properly */ - ret = cpufreq_table_validate_and_show(policy, table); - if (ret) { - pr_err("invalid frequency table: %d\n", ret); - goto err_nomem1; - } - + policy->freq_table = table; data->table = table; /* update ->cpus if we have cluster, no harm if not */ @@ -236,8 +229,6 @@ static int qoriq_cpufreq_cpu_init(struct cpufreq_policy *policy) return 0; -err_nomem1: - kfree(table); err_pclk: kfree(data->pclk); err_nomem2: