linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PM / Domain: remove conditional from error case
@ 2017-03-17  5:49 Viresh Kumar
  0 siblings, 0 replies; only message in thread
From: Viresh Kumar @ 2017-03-17  5:49 UTC (permalink / raw)
  To: Rafael Wysocki, Kevin Hilman, Ulf Hansson, Pavel Machek,
	Len Brown
  Cc: linaro-kernel, linux-pm, linux-kernel, Vincent Guittot,
	Viresh Kumar

There is no point running the conditional 'if' statement if the genpd
isn't present.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/base/power/domain.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c
index 202effbebfd1..03dd7a61f08a 100644
--- a/drivers/base/power/domain.c
+++ b/drivers/base/power/domain.c
@@ -1789,12 +1789,12 @@ int of_genpd_add_provider_simple(struct device_node *np,
 
 	mutex_lock(&gpd_list_lock);
 
-	if (pm_genpd_present(genpd))
+	if (pm_genpd_present(genpd)) {
 		ret = genpd_add_provider(np, genpd_xlate_simple, genpd);
-
-	if (!ret) {
-		genpd->provider = &np->fwnode;
-		genpd->has_provider = true;
+		if (!ret) {
+			genpd->provider = &np->fwnode;
+			genpd->has_provider = true;
+		}
 	}
 
 	mutex_unlock(&gpd_list_lock);
-- 
2.12.0.432.g71c3a4f4ba37

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-17  5:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-17  5:49 [PATCH] PM / Domain: remove conditional from error case Viresh Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).