Skip to content

Commit d97fe10

Browse files
Ulf Hanssonrafaeljw
authored andcommitted
PM: domains: Return early if perf state is already set for the device
When dev_pm_genpd_set_performance_state() gets called to set a new performance state for the device, let's take a quicker path by doing an early return, if it turns out that the new state is already set for the device. Suggested-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0eef091 commit d97fe10

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/base/power/domain.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,9 @@ static int genpd_set_performance_state(struct device *dev, unsigned int state)
387387
int ret;
388388

389389
prev_state = gpd_data->performance_state;
390+
if (prev_state == state)
391+
return 0;
392+
390393
gpd_data->performance_state = state;
391394
state = _genpd_reeval_performance_state(genpd, state);
392395

0 commit comments

Comments
 (0)