Skip to content

Commit d97fe10

Browse files
storulfrafaeljw
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 <[email protected]> Signed-off-by: Ulf Hansson <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 0eef091 commit d97fe10

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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)