From patchwork Mon Feb 26 05:08:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 10241253 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 330B460208 for ; Mon, 26 Feb 2018 05:10:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20602292DF for ; Mon, 26 Feb 2018 05:10:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 11F92297C3; Mon, 26 Feb 2018 05:10:03 +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 BCBDA292DF for ; Mon, 26 Feb 2018 05:10:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751706AbeBZFKC (ORCPT ); Mon, 26 Feb 2018 00:10:02 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:35614 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbeBZFKB (ORCPT ); Mon, 26 Feb 2018 00:10:01 -0500 Received: by mail-pg0-f68.google.com with SMTP id l131so5778543pga.2 for ; Sun, 25 Feb 2018 21:10:01 -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=7QGZw8xY1AzKmWeZQrfRD07I9AonUp4Z/GOKO/Ikvbw=; b=eCPtDp91vBN5ijuIryNZwCbBFf2J+afAvNmlf45rtxRWtzvHTTgCj/CGv32rD311Ph xGYtsF3lJ6v2o7ZqAwbGAhGt+NKVEuwFjUzs6D/vk9lyu0h36Qaxzw6jq79LO8FIqUVy tIHNZdR27ubCqZJ0T0URx1Gs9hqMs0OB+kOjw= 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=7QGZw8xY1AzKmWeZQrfRD07I9AonUp4Z/GOKO/Ikvbw=; b=tU66DddAbCEbqgW265Mvqs4LVBM1f0Xuddhl7SzEzeHFJCu37vCRcDOSpgjJoqr/gO eCwJla8b8lk+nBuVOJQfph6ai7gx5cLmIsn4XJ2nEvWe1W8VHhJMOIvNTG/AdxDy1mlS rdmojCxuIePGm8oIE86OwSAi6m819Y827+/QJW9/CK7qhEHIhctQ0RgB8P9hju2gAw3m eO/gwnmcNVF7PN8Kppjz7w4fc8lyE+3a6ERGsDI6c+SrEApjqWJLaB5/HrwVyb0B02nn nK/u+g3Ljo7tmIo8e5xWW8MqMvjnOR+QMLE84H5ke8uSQsdfRjEIgNzQPQRf3o33lz2l 0h1g== X-Gm-Message-State: APf1xPD3Aw+fyyNwn0VFD0MdIXiEF8RtA/jZcBDYMlslpKQKBxFGpyzV h5CBMW1KBGR1bA3A0SDuZ8M14A== X-Google-Smtp-Source: AH8x224ps6f2GDg83IaQQ/oUrhUtOW1Ii4I/oCgJHiYszS0n73kbFdIFFOEdOQAZeFVO07Wv4dQ3JA== X-Received: by 10.101.101.78 with SMTP id a14mr7406828pgw.368.1519621801018; Sun, 25 Feb 2018 21:10:01 -0800 (PST) Received: from localhost ([122.172.92.38]) by smtp.gmail.com with ESMTPSA id i125sm6740325pfe.176.2018.02.25.21.10.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 25 Feb 2018 21:10:00 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Matthias Brugger Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 12/27] cpufreq: mediatek: Don't validate the frequency table twice Date: Mon, 26 Feb 2018 10:38:55 +0530 Message-Id: <19a79fac3ea680f23690e4d995539f4b21213275.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 mediatek driver. Signed-off-by: Viresh Kumar --- drivers/cpufreq/mediatek-cpufreq.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c index 84d658d57029..eb8920d39818 100644 --- a/drivers/cpufreq/mediatek-cpufreq.c +++ b/drivers/cpufreq/mediatek-cpufreq.c @@ -460,21 +460,12 @@ static int mtk_cpufreq_init(struct cpufreq_policy *policy) return ret; } - ret = cpufreq_table_validate_and_show(policy, freq_table); - if (ret) { - pr_err("%s: invalid frequency table: %d\n", __func__, ret); - goto out_free_cpufreq_table; - } - cpumask_copy(policy->cpus, &info->cpus); + policy->freq_table = freq_table; policy->driver_data = info; policy->clk = info->cpu_clk; return 0; - -out_free_cpufreq_table: - dev_pm_opp_free_cpufreq_table(info->cpu_dev, &freq_table); - return ret; } static int mtk_cpufreq_exit(struct cpufreq_policy *policy)