From patchwork Mon Feb 26 05:08:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10241259 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 6737B60208 for ; Mon, 26 Feb 2018 05:10:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59020292DF for ; Mon, 26 Feb 2018 05:10:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4C53A297C3; Mon, 26 Feb 2018 05:10:11 +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 DD51F292DF for ; Mon, 26 Feb 2018 05:10:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751959AbeBZFKK (ORCPT ); Mon, 26 Feb 2018 00:10:10 -0500 Received: from mail-pl0-f67.google.com ([209.85.160.67]:44270 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751175AbeBZFKJ (ORCPT ); Mon, 26 Feb 2018 00:10:09 -0500 Received: by mail-pl0-f67.google.com with SMTP id w21so8654435plp.11 for ; Sun, 25 Feb 2018 21:10:09 -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=S9I5NEQLmCJXPHbik4waQr5Xe6PeubJ1kIWZIQAIp0k=; b=S/5TVUJLTzR6/kgtf5zQi07cRVGGtZIHmmEjMAiFnw/V+Dqma/1mzgO46kMCeLQ1nL T7w5q4XY6xbGKAOP56Ug94WcSeHH8IDJVFwpj6VxMwaVuITvNLJeJ2O/C/7TGcS2q9lN 2puUjN6gPG28GxiGvfUdcg7xW/My404ee+XpI= 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=S9I5NEQLmCJXPHbik4waQr5Xe6PeubJ1kIWZIQAIp0k=; b=qA+wdPe/x0zcMLxbUdLgFLCHn9fWxBBLqAAoUSgXbkTjHOshClSvx8MBUTE044c0JA 4BzlXo/V5aT1xZUK+pFrdDFak2ErnYreueX/2ej4xeMyKiI8RP/bEJIcOgy4eZQY3EO9 65DoGw0C5QsYacHIPSfxE6FmywNMorvZEyv//D8fGAjYVWUMk9P66IoWUHc4ZmsSRQ0Q X7v6aynsXgX7kZVIwn1vEA/0FozWyW4KMVETUvEhoZd1y9pbvihdZHpiNzcwAOISbVIE PGQ/Rm43VnkXWJWSbBYP7GzDpxZFp5fPil5tG+ZGkzTuy4YTR73sf1zk5TGX8Y9eYOk6 JC3A== X-Gm-Message-State: APf1xPBbZzrc0zm2Zj+vsJYbyK66DSfqfR2eE3+QSnDFN6IDyEG2w8s5 ZY/2nPi2pGHwzL7H/2Bw8bHnVw== X-Google-Smtp-Source: AH8x227o1Co9rjJASJH0KqvxEx6gUWQPgD22UuAbHztAtKFiWI8jTa1xFwpCumNDIPFLLwoUR9IKNA== X-Received: by 2002:a17:902:536a:: with SMTP id b97-v6mr9390907pli.421.1519621809307; Sun, 25 Feb 2018 21:10:09 -0800 (PST) Received: from localhost ([122.172.92.38]) by smtp.gmail.com with ESMTPSA id u27sm11171721pfk.172.2018.02.25.21.10.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Feb 2018 21:10:08 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , linuxppc-dev@lists.ozlabs.org Subject: [PATCH 15/27] cpufreq: powerenv: Don't validate the frequency table twice Date: Mon, 26 Feb 2018 10:38:58 +0530 Message-Id: <3120e4db4ae3bc014d198a206f46be1305ec65e8.1519620578.git.viresh.kumar@linaro.org> 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 powerenv driver. Signed-off-by: Viresh Kumar --- drivers/cpufreq/powernv-cpufreq.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c index 29cdec198657..0591874856d3 100644 --- a/drivers/cpufreq/powernv-cpufreq.c +++ b/drivers/cpufreq/powernv-cpufreq.c @@ -812,7 +812,7 @@ static int powernv_cpufreq_target_index(struct cpufreq_policy *policy, static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy) { - int base, i, ret; + int base, i; struct kernfs_node *kn; struct global_pstate_info *gpstates; @@ -848,15 +848,10 @@ static int powernv_cpufreq_cpu_init(struct cpufreq_policy *policy) gpstates->timer.expires = jiffies + msecs_to_jiffies(GPSTATE_TIMER_INTERVAL); spin_lock_init(&gpstates->gpstate_lock); - ret = cpufreq_table_validate_and_show(policy, powernv_freqs); - - if (ret < 0) { - kfree(policy->driver_data); - return ret; - } + policy->freq_table = powernv_freqs; policy->fast_switch_possible = true; - return ret; + return 0; } static int powernv_cpufreq_cpu_exit(struct cpufreq_policy *policy)