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: 129544 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp3230629lja; Sun, 25 Feb 2018 21:10:19 -0800 (PST) X-Google-Smtp-Source: AH8x225QGrM3NEpvmpQZh64GBCSaMv4806WVSsMyKpwEqb+vk8ILE4MRErpfktnEvIbtfpVvI77F X-Received: by 10.167.130.88 with SMTP id e24mr9292715pfn.169.1519621819539; Sun, 25 Feb 2018 21:10:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519621819; cv=none; d=google.com; s=arc-20160816; b=gMftWgvgXB+wqopg6jbqCFzx0sNdLa4QASt8RNuSYIABPZm8m/Jw6IU7EVxxfxyhNY AqwmyxWszts8YGsGH45/OiDWbg+6PVcCJ9M5W9Pimew7gsdNSFMQeFKXdQA71zfZ0GPa ZrA7GNwzoUZPDthy6QWgaftJuRYyZVQ44Ua6NK/q6aUbiQzWqTxhNcpC81cgXYgJClbn 0LmwGUWDkqZ62GOGYbOiBXfGS5qjSnqFTuOLjnzd+beHfLBmPRBc9IOJTltYM5bxvKal DMbKjNk19bd0onj0Jhi4R4DpaLumt12WGcrgGq+LSnSH+GdZ0e/ZyS8k0zXg5ISPjzBl J2QQ== 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=qh/+GpEvGyuW/Zspx9kpe7jf9gBjpRlz09+U9WjLNu8=; b=Ik3w/D7p6Ei9nYlk2/cMg+0/RNL8gbF0Cvn4kpuZ+vvaeKwtgR9RVikN6MSJUSaae8 9HZ64S7a/2V21GG0nKCWuPLbhbX9Ur1FSkdREBJQi0WDxzDLMkv983CPgSDhErS+nPNC lllJOAL6IQdjhM38Vr3x3PI6sm0bnxm0TXV/Bqudw45MbNgwZUoLfz9PVqRd6Rzf1SL4 Y0dSFx6GEJZUayVBbTx46cUcLsfeDegLDHSz+E6XcnuaGpwT/X6JzN/2wC8tbYePxy2Z 14ErGzpAH9oRn2djDSqOqSTw3/qUfjw/I223rNjq5BCaYGi+l060wqjl/QMIfwX1OqiO So4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dhfxHY5R; 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.19; Sun, 25 Feb 2018 21:10:19 -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=dhfxHY5R; 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 S1751967AbeBZFKS (ORCPT + 11 others); 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-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 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(-) -- 2.15.0.194.g9af6a3dea062 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: