Skip to content

Commit

Permalink
PM / devfreq: Set scaling_max_freq to max on OPP notifier error
Browse files Browse the repository at this point in the history
The devfreq_notifier_call functions will update scaling_min_freq and
scaling_max_freq when the OPP table is updated.

If fetching the maximum frequency fails then scaling_max_freq remains
set to zero which is confusing. Set to ULONG_MAX instead so we don't
need special handling for this case in other places.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
  • Loading branch information
cdleonard authored and chanwoochoi committed Dec 9, 2019
1 parent e876e71 commit e7cc792
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/devfreq/devfreq.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,10 @@ static int devfreq_notifier_call(struct notifier_block *nb, unsigned long type,
goto out;

devfreq->scaling_max_freq = find_available_max_freq(devfreq);
if (!devfreq->scaling_max_freq)
if (!devfreq->scaling_max_freq) {
devfreq->scaling_max_freq = ULONG_MAX;
goto out;
}

err = update_devfreq(devfreq);

Expand Down

0 comments on commit e7cc792

Please sign in to comment.