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: 129538 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp3230415lja; Sun, 25 Feb 2018 21:10:03 -0800 (PST) X-Google-Smtp-Source: AG47ELuHpVrXI1emxRosuXoNO9l8ZjdWiTPyvflgLDZZqOAwqbCaVXV0baVUIADw3GhxNA9Sr7fa X-Received: by 2002:a17:902:6d0f:: with SMTP id s15-v6mr2465403plk.375.1519621803020; Sun, 25 Feb 2018 21:10:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519621803; cv=none; d=google.com; s=arc-20160816; b=rUOtSf5aCueAY8/FmtUnOzOL34O9s6RCnT3QbEfGDNob3405KRsDA4ZMV7kUbdQiEd 7Frieou7v/OU1LpOn9meaXFNq61UXAl7BFXqv6y+9Q1ZA038H/a2v+I1cug22ia4qnxC Nhlf8se0YUqTerruRCvZWuS2eVUfGFpquOG3UFh7Qv/daIHmzXw8Win3N6rrp8Wq1tr4 UDKJN0KzpTdhzuN6ynUqJBdckpMHOyLVbmdk/iHmRAMU4GHbqXv6aq73MfG9fXO9vl4E jX40VaYmZxJJm8parjJi6uSwFlWVnirqOAvuKQ7GUmGYoWhLcKjp/FaNeIJhu9LBP6TQ czLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=7QGZw8xY1AzKmWeZQrfRD07I9AonUp4Z/GOKO/Ikvbw=; b=BsLxxBxjOc9yb5vAwNTQ0CD0UaaW8b68Zz9jawlltrZdbNc9ctCTHArTsiFD4fR9qp 4dXILS/wCfYRoNoZ2SdydAzGV4c+gp2PtynN5wxZs/X2oUVKAvBIMkoSKkh6pUuUJVNA BcilOf5FIYQDXEM4BVaGLGpTO5gZ2sTJ1ME1o80BT5vwfEPTZ9NAHJga/TciqrvnAjhm CoM9zq+ej38bYIdcaGvI2+Wmh9r94GwyW/zR/rmK8zDcqXP6tKViGNZogucpft2qVBWi hDt9ffJ0ddAVd+scp5u4rn1DQGLn0HLqc2+B7HSWnQ7PezTsIJSLWIcWRrtwGw4K8JlN ssJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eCPtDp91; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h32-v6si6199354pld.217.2018.02.25.21.10.02; Sun, 25 Feb 2018 21:10:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eCPtDp91; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751706AbeBZFKC (ORCPT + 11 others); 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-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 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(-) -- 2.15.0.194.g9af6a3dea062 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)