From: Leonard Crestez Date: Thu, 31 Oct 2019 21:34:19 +0000 (+0200) Subject: PM / devfreq: Set scaling_max_freq to max on OPP notifier error X-Git-Tag: v5.5-rc2~20^2~1^2~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7cc792d00049c874010b398a27c3cc7bc8fef34;p=thirdparty%2Fkernel%2Flinux.git PM / devfreq: Set scaling_max_freq to max on OPP notifier error 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 Reviewed-by: Matthias Kaehlcke Reviewed-by: Chanwoo Choi Signed-off-by: Chanwoo Choi --- diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 4de70bd0f63d5..66f0a795442ba 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -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);