From patchwork Thu Jan 21 11:17:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 367817 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp490898jam; Thu, 21 Jan 2021 03:47:40 -0800 (PST) X-Google-Smtp-Source: ABdhPJwXLjh8ey4cdd0kWJvZCIObPFrbC8WRjigMIgOeUforGmLMZfDnrXkL02YJ3oGkf8sVDgG5 X-Received: by 2002:a17:907:7252:: with SMTP id ds18mr4263666ejc.239.1611229659955; Thu, 21 Jan 2021 03:47:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611229659; cv=none; d=google.com; s=arc-20160816; b=fNGn7QTfS6bMM9eC9T4c/5wf0N4ZWdrPAsXotNE5pZibP8AjRECkYv5ffLXD1ConNK KzCGzUz30Ai/jKk8XuApUwFGq19PpLP2hbATMKe/STfvZkQnxWYjVIWtjfLicU4rrotO bENlA5pJ+sRqSVgVqtn7Ag6LpHyffIS/TintEoI6P9wyVs0Jzh6AJGB+CxYWBTEZHEQ+ LOMEscKuIiMQ9y1Awykq9wDtBFZdi+AIhiLwiVOeo+c6p3CqpPoYRKLaQ36lHXLxnD/J ZGH5RpSCGo7P7TPZmKKKCpQUYdrY7GGJVKuZUNYf6Vwz9hVmOd1xV+gvloX3d4RM6sGf T7AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QsvG3t6xFRgx0s76cOQVzbYkqHL9lM3bJ086HXut2lo=; b=w+rJEP6QUAcpVaH7G1G2V44SNwSIA1VWk4ZFRTjs0WJJyxD3iKPAyzaaTy3GYc9ak0 syNoHmShYcFKKb4dNgyQqx2faFwBwRwrL0yiWIWY4Zuk4lgU+Lc5+C0SUDqrLFjDVaz7 sHcfr2bm+pP7kqBF9iUx7b9sJEpb4sAjDE8tLohXVL4pC5sTeq8eFEP3Xp9fj5JKaymm yyTNwsolUWYdp2nUylxnfHW0Ezb8A0o+j2SjZBGE+CmxH5r/s80iuwT4sCMFmLtdRjEf ReWGhLWlQzM/Eh9M7ymyERuchjlOfj+aP+lnp3dZT4c24tBMmdaIjftyj/htM91abSFc bmTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W8sAOHZX; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id w4si1683299ejb.499.2021.01.21.03.47.39; Thu, 21 Jan 2021 03:47:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=W8sAOHZX; spf=pass (google.com: domain of linux-pm-owner@vger.kernel.org designates 23.128.96.18 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 S1730494AbhAULrH (ORCPT + 7 others); Thu, 21 Jan 2021 06:47:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730223AbhAULVe (ORCPT ); Thu, 21 Jan 2021 06:21:34 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23C42C0617A1 for ; Thu, 21 Jan 2021 03:19:07 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id w18so1302910pfu.9 for ; Thu, 21 Jan 2021 03:19:07 -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 :mime-version:content-transfer-encoding; bh=QsvG3t6xFRgx0s76cOQVzbYkqHL9lM3bJ086HXut2lo=; b=W8sAOHZXGjGsUHf8lA5IP8zqppO9iNNGBAO/qkfocVkFGmZSsW/naH1YNTl0xP/gTa gY50hBXssIxtuU2G59zExSMtcwVt7utDVVzmh6u9fjrD+gxfwmaw+ao5wN7cr/pBoIw3 oRUkfsAVRcuJw664wy7zI0ZnVC2itA4TtpRfrtC0Gl5gtFhl4IOvROR/LH20rudx7rlv gWtqNMLBkoXlXYJmuXSwOzf/XejjXh9qiAA0ZlrkJH/afNscVDAJM3rbqNgElgUCPqRm UBPCokJYgpbAq0qwbubfijtQgJxq9EDuL0R+iegFbZcUTi60rDsqp0znC1i8ZppPwSnH /QqA== 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:mime-version:content-transfer-encoding; bh=QsvG3t6xFRgx0s76cOQVzbYkqHL9lM3bJ086HXut2lo=; b=cKqX6LzbRNUn2S3TGyJ5kjauaIydodz+Pi0HjjqPn+hXlwZYeSGnOT5Nt8GPFyXBm3 pNqgUXXUnh1zuecZCRZanakqelXcGsH+w26LoGab3iiPeJowU4BUiJ3cBHL+3IVA7hzr xzdujxLV5NYKLjpIMtr9UAaMYma/MIn95u8i5dTtbk4cFtAUNQsQbJ3DA7nAcXnJGJUb CKerYwDcD2HOUC99tjre/uTSGV7z0iWozm5Sd0EhcyRYt4+21ADIbdxIA6ZASlXhYDS+ TqKH6Ey1/AecleD4Lw0jhfbGdrSGkyrJed2AmKC/Yqerc+ixZICSDS3PxzF3I3Y9h0Bx jH/g== X-Gm-Message-State: AOAM530xOKwH4DeOIbL5BLWmFHF6pdnK/yZ7BTU6Q5xEgr0IfL+acNOp CYQoxiqCJkgw92mIaFZZtKWqfw== X-Received: by 2002:a65:6542:: with SMTP id a2mr13920489pgw.148.1611227946652; Thu, 21 Jan 2021 03:19:06 -0800 (PST) Received: from localhost ([122.172.59.240]) by smtp.gmail.com with ESMTPSA id gk2sm5826702pjb.6.2021.01.21.03.19.05 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Jan 2021 03:19:06 -0800 (PST) From: Viresh Kumar To: Dmitry Osipenko , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Sibi Sankar , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 08/13] opp: Update parameters of _set_opp_custom() Date: Thu, 21 Jan 2021 16:47:48 +0530 Message-Id: <296a3a64a673ed3eb261a6fc06f4dfd90dbca479.1611227342.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Drop the unnecessary parameters and follow the pattern from _generic_set_opp_regulator(). While at it, also remove the local variable old_freq. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 6b09d468d37a..3500cc9de66b 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -826,11 +826,10 @@ static int _set_opp_bw(const struct opp_table *opp_table, } static int _set_opp_custom(const struct opp_table *opp_table, - struct device *dev, unsigned long old_freq, - unsigned long freq, - struct dev_pm_opp_supply *old_supply, - struct dev_pm_opp_supply *new_supply) + struct device *dev, struct dev_pm_opp *opp, + unsigned long freq) { + struct dev_pm_opp *old_opp = opp_table->current_opp; struct dev_pm_set_opp_data *data; int size; @@ -840,12 +839,12 @@ static int _set_opp_custom(const struct opp_table *opp_table, data->clk = opp_table->clk; data->dev = dev; - data->old_opp.rate = old_freq; - size = sizeof(*old_supply) * opp_table->regulator_count; - memcpy(data->old_opp.supplies, old_supply, size); + data->old_opp.rate = old_opp->rate; + size = sizeof(*old_opp->supplies) * opp_table->regulator_count; + memcpy(data->old_opp.supplies, old_opp->supplies, size); data->new_opp.rate = freq; - memcpy(data->new_opp.supplies, new_supply, size); + memcpy(data->new_opp.supplies, opp->supplies, size); return opp_table->set_opp(data); } @@ -1000,7 +999,6 @@ static int _set_opp(struct device *dev, struct opp_table *opp_table, struct dev_pm_opp *opp, unsigned long freq) { struct dev_pm_opp *old_opp; - unsigned long old_freq; int scaling_down, ret; if (unlikely(!opp)) @@ -1011,7 +1009,6 @@ static int _set_opp(struct device *dev, struct opp_table *opp_table, _find_current_opp(dev, opp_table); old_opp = opp_table->current_opp; - old_freq = old_opp->rate; /* Return early if nothing to do */ if (opp_table->enabled && old_opp == opp) { @@ -1020,7 +1017,7 @@ static int _set_opp(struct device *dev, struct opp_table *opp_table, } dev_dbg(dev, "%s: switching OPP: Freq %lu -> %lu Hz, Level %u -> %u, Bw %u -> %u\n", - __func__, old_freq, freq, old_opp->level, opp->level, + __func__, old_opp->rate, freq, old_opp->level, opp->level, old_opp->bandwidth ? old_opp->bandwidth[0].peak : 0, opp->bandwidth ? opp->bandwidth[0].peak : 0); @@ -1036,8 +1033,7 @@ static int _set_opp(struct device *dev, struct opp_table *opp_table, } if (opp_table->set_opp) { - ret = _set_opp_custom(opp_table, dev, old_freq, freq, - old_opp->supplies, opp->supplies); + ret = _set_opp_custom(opp_table, dev, opp, freq); } else if (opp_table->regulators) { ret = _generic_set_opp_regulator(opp_table, dev, opp, freq, scaling_down);