Skip to content

Commit

Permalink
PM / Domain: remove conditional from error case
Browse files Browse the repository at this point in the history
There is no point running the conditional 'if' statement if the genpd
isn't present.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Viresh Kumar authored and Rafael J. Wysocki committed Mar 28, 2017
1 parent c02ed2e commit 8ce9584
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/base/power/domain.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8ce9584

Please sign in to comment.