mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Jun Nie <jun.nie@linaro.org>, Viresh Kumar <vireshk@kernel.org>,
	Nishanth Menon <nm@ti.com>, Stephen Boyd <sboyd@kernel.org>
Cc: Viresh Kumar <viresh.kumar@linaro.org>,
	linux-pm@vger.kernel.org,
	Vincent Guittot <vincent.guittot@linaro.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 1/3] OPP: Handle all genpd cases together in _set_required_opps()
Date: Wed, 22 Feb 2023 16:36:37 +0530	[thread overview]
Message-ID: <8f9fba47f91ef04fa2cf0c3adba9299a23d5280a.1677063656.git.viresh.kumar@linaro.org> (raw)
In-Reply-To: <cover.1677063656.git.viresh.kumar@linaro.org>

There is no real need of keeping separate code for single genpd case, it
can be made to work with a simple change.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/opp/core.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/opp/core.c b/drivers/opp/core.c
index e87567dbe99f..6d7016ce8c53 100644
--- a/drivers/opp/core.c
+++ b/drivers/opp/core.c
@@ -959,7 +959,8 @@ static int _set_required_opps(struct device *dev,
 			      struct dev_pm_opp *opp, bool up)
 {
 	struct opp_table **required_opp_tables = opp_table->required_opp_tables;
-	struct device **genpd_virt_devs = opp_table->genpd_virt_devs;
+	struct device **genpd_virt_devs =
+		opp_table->genpd_virt_devs ? opp_table->genpd_virt_devs : &dev;
 	int i, ret = 0;
 
 	if (!required_opp_tables)
@@ -979,12 +980,6 @@ static int _set_required_opps(struct device *dev,
 		return -ENOENT;
 	}
 
-	/* Single genpd case */
-	if (!genpd_virt_devs)
-		return _set_required_opp(dev, dev, opp, 0);
-
-	/* Multiple genpd case */
-
 	/*
 	 * Acquire genpd_virt_dev_lock to make sure we don't use a genpd_dev
 	 * after it is freed from another thread.
-- 
2.31.1.272.g89b43f80a514


  reply	other threads:[~2023-02-22 11:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22 11:06 [PATCH 0/3] OPP: Simplify set_required_opp handling Viresh Kumar
2023-02-22 11:06 ` Viresh Kumar [this message]
2023-03-01 13:03   ` [PATCH 1/3] OPP: Handle all genpd cases together in _set_required_opps() Ulf Hansson
2023-02-22 11:06 ` [PATCH 2/3] OPP: Move required opps configuration to specialized callback Viresh Kumar
2023-03-01 13:06   ` Ulf Hansson
2023-04-03  4:29     ` Viresh Kumar
2023-02-22 11:06 ` [PATCH 3/3] OPP: Allow platforms to add a set_required_opps() callback Viresh Kumar
2023-02-23  9:56 ` [PATCH 0/3] OPP: Simplify set_required_opp handling Jun Nie
2023-02-24  2:17   ` Viresh Kumar
2023-02-24  8:17     ` Jun Nie
2023-02-27  4:23       ` Viresh Kumar
2023-02-27  9:21         ` Jun Nie
2023-02-27  9:29           ` Viresh Kumar
2023-03-06 10:48             ` Jun Nie
2023-04-03  4:30               ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8f9fba47f91ef04fa2cf0c3adba9299a23d5280a.1677063656.git.viresh.kumar@linaro.org \
    --to=viresh.kumar@linaro.org \
    --cc=jun.nie@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=nm@ti.com \
    --cc=rafael@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vireshk@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®