From 8ce95844c85349243520b6943ec1225a047d7d6c Mon Sep 17 00:00:00 2001 From: Viresh Kumar Date: Fri, 17 Mar 2017 11:19:21 +0530 Subject: [PATCH] PM / Domain: remove conditional from error case There is no point running the conditional 'if' statement if the genpd isn't present. Signed-off-by: Viresh Kumar Signed-off-by: Rafael J. Wysocki --- 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 e697dec9d25b..1a0549f1944a 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1700,12 +1700,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.39.5