From patchwork Fri Jun 10 08:20:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 12876691 X-Patchwork-Delegate: viresh.linux@gmail.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E86D2C433EF for ; Fri, 10 Jun 2022 08:24:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347673AbiFJIYj (ORCPT ); Fri, 10 Jun 2022 04:24:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347617AbiFJIYP (ORCPT ); Fri, 10 Jun 2022 04:24:15 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C604C3EB9CC for ; Fri, 10 Jun 2022 01:21:10 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id n18so22236101plg.5 for ; Fri, 10 Jun 2022 01:21:10 -0700 (PDT) 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=/vcF/QNpvPLcA4RHww4ViDk70wdKPxBVofdBW3sgq5c=; b=p7V4YUibibj9AvSgBH2AE999cHg+ec4xuwtZHf4oCKGnASuR7Jk0TqhUUEF8XaOR+r wxrU+j3QghaV8hAB+Mvm7zWzgiR8PrkF6FJiBDH3G6YzWYJr5ALY7k090vQONfMRnqGz vZyYQPntTUBRfaqBoadikhkcg9ew+Deswu/DB5qzND4R/Re+hF6ZHZO7pRBGchYvuh31 0o8C8nuOLY+O9O1rY1t04DJ55Z74U3IQGI0+lPuUcillbKNVNihZ4TITwbccLshYVfHW 5RjBUvwS6JJEh/6dMcUm+pwOMB1QW/paW/1WuwqRkMabzSMgl2Nbdv3U1GxaUuZ7gb2I hbhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/vcF/QNpvPLcA4RHww4ViDk70wdKPxBVofdBW3sgq5c=; b=Bu3VvEtT3MVveblF06pdlbSCJIIAV9vxzStBW7smQzYGGNYdEX2tegLTmlU7Q9vVVp LAawznXFH3SeWeC7X0WRS/RjPWwXwfbUrJqh0WcjLzHdgkU6xhCmHR+YE3hce9l/dJ8G TYEK8H7f614pFTlfc2yHp5NwRq3wzj5CiSFBQCPTKKwTLqYmrnie709+tIFrhuKsW6pk Oda9mVR3XJACVVp7JR1YP14c4ZAE+c485cC4BfZk70xePfqbZcRji41IY0cvzXAZCIlw XE1gQNHZ1y3MjPQdXHwpHG8xT2AYjG3JGONQXDFUkwjcuVgbIBRW9VHOLrQUpPOh8plk C1EA== X-Gm-Message-State: AOAM532ZZHJKLQzPntHNWozLpwhEDQjBO1EV+OoGGZcpOK3XnvfR11KZ /Y+ZpW2RlA99YKeFWNhJPiI8uQ== X-Google-Smtp-Source: ABdhPJw7e/wORoEphD60Ma+eCczcirA3YOZoOwIoYuv97QFY+ER1reFifPnoU6cQu5aFzCmqGq8K8w== X-Received: by 2002:a17:90b:368b:b0:1e6:67a0:1c17 with SMTP id mj11-20020a17090b368b00b001e667a01c17mr7494284pjb.203.1654849269662; Fri, 10 Jun 2022 01:21:09 -0700 (PDT) Received: from localhost ([122.162.234.2]) by smtp.gmail.com with ESMTPSA id w4-20020a17090aaf8400b001e0abbc3a74sm1092638pjq.5.2022.06.10.01.21.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 01:21:09 -0700 (PDT) From: Viresh Kumar To: Krzysztof Kozlowski , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: [PATCH 2/8] OPP: Remove rate_not_available parameter to _opp_add() Date: Fri, 10 Jun 2022 13:50:46 +0530 Message-Id: X-Mailer: git-send-email 2.31.1.272.g89b43f80a514 In-Reply-To: References: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org commit 32715be4fe95 ("opp: Fix adding OPP entries in a wrong order if rate is unavailable") removed the only user of this field, get rid of rest of it now. Signed-off-by: Viresh Kumar --- drivers/opp/core.c | 4 ++-- drivers/opp/of.c | 10 ++++------ drivers/opp/opp.h | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/opp/core.c b/drivers/opp/core.c index 404f43759066..fe447f41c99e 100644 --- a/drivers/opp/core.c +++ b/drivers/opp/core.c @@ -1695,7 +1695,7 @@ void _required_opps_available(struct dev_pm_opp *opp, int count) * should be considered an error by the callers of _opp_add(). */ int _opp_add(struct device *dev, struct dev_pm_opp *new_opp, - struct opp_table *opp_table, bool rate_not_available) + struct opp_table *opp_table) { struct list_head *head; int ret; @@ -1774,7 +1774,7 @@ int _opp_add_v1(struct opp_table *opp_table, struct device *dev, new_opp->available = true; new_opp->dynamic = dynamic; - ret = _opp_add(dev, new_opp, opp_table, false); + ret = _opp_add(dev, new_opp, opp_table); if (ret) { /* Don't return error for duplicate OPPs */ if (ret == -EBUSY) diff --git a/drivers/opp/of.c b/drivers/opp/of.c index e07fc31de416..bec9644a7260 100644 --- a/drivers/opp/of.c +++ b/drivers/opp/of.c @@ -808,8 +808,8 @@ static int _read_bw(struct dev_pm_opp *new_opp, struct opp_table *opp_table, return ret; } -static int _read_opp_key(struct dev_pm_opp *new_opp, struct opp_table *opp_table, - struct device_node *np, bool *rate_not_available) +static int _read_opp_key(struct dev_pm_opp *new_opp, + struct opp_table *opp_table, struct device_node *np) { bool found = false; u64 rate; @@ -825,7 +825,6 @@ static int _read_opp_key(struct dev_pm_opp *new_opp, struct opp_table *opp_table new_opp->rate = (unsigned long)rate; found = true; } - *rate_not_available = !!ret; /* * Bandwidth consists of peak and average (optional) values: @@ -881,13 +880,12 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table, struct dev_pm_opp *new_opp; u32 val; int ret; - bool rate_not_available = false; new_opp = _opp_allocate(opp_table); if (!new_opp) return ERR_PTR(-ENOMEM); - ret = _read_opp_key(new_opp, opp_table, np, &rate_not_available); + ret = _read_opp_key(new_opp, opp_table, np); if (ret < 0) { dev_err(dev, "%s: opp key field not found\n", __func__); goto free_opp; @@ -920,7 +918,7 @@ static struct dev_pm_opp *_opp_add_static_v2(struct opp_table *opp_table, if (opp_table->is_genpd) new_opp->pstate = pm_genpd_opp_to_performance_state(dev, new_opp); - ret = _opp_add(dev, new_opp, opp_table, rate_not_available); + ret = _opp_add(dev, new_opp, opp_table); if (ret) { /* Don't return error for duplicate OPPs */ if (ret == -EBUSY) diff --git a/drivers/opp/opp.h b/drivers/opp/opp.h index 407eee9f10ab..4d8894ef2975 100644 --- a/drivers/opp/opp.h +++ b/drivers/opp/opp.h @@ -226,7 +226,7 @@ struct opp_device *_add_opp_dev(const struct device *dev, struct opp_table *opp_ struct dev_pm_opp *_opp_allocate(struct opp_table *opp_table); void _opp_free(struct dev_pm_opp *opp); int _opp_compare_key(struct dev_pm_opp *opp1, struct dev_pm_opp *opp2); -int _opp_add(struct device *dev, struct dev_pm_opp *new_opp, struct opp_table *opp_table, bool rate_not_available); +int _opp_add(struct device *dev, struct dev_pm_opp *new_opp, struct opp_table *opp_table); int _opp_add_v1(struct opp_table *opp_table, struct device *dev, unsigned long freq, long u_volt, bool dynamic); void _dev_pm_opp_cpumask_remove_table(const struct cpumask *cpumask, int last_cpu); struct opp_table *_add_opp_table_indexed(struct device *dev, int index, bool getclk);