diff options
author | Matthias Kaehlcke <mka@chromium.org> | 2018-05-25 16:30:33 -0400 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2018-07-18 00:58:38 -0400 |
commit | 2c2cb1e6b05b90d55b4b943646faa3cfbdf78f6e (patch) | |
tree | c96778ecf3b0263c9aaa056d07c1b656b87c2de8 /drivers/devfreq/devfreq.c | |
parent | dfa7d764caf00b12da276ea473d7f1fd7fd40200 (diff) |
PM / devfreq: Init user limits from OPP limits, not viceversa
Commit ab8f58ad72c4 ("PM / devfreq: Set min/max_freq when adding
the devfreq device") introduced the initialization of the user
limits min/max_freq from the lowest/highest available OPPs. Later
commit f1d981eaecf8 ("PM / devfreq: Use the available min/max
frequency") added scaling_min/max_freq, which actually represent
the frequencies of the lowest/highest available OPP. scaling_min/
max_freq are initialized with the values from min/max_freq, which
is totally correct in the context, but a bit awkward to read.
Swap the initialization and assign scaling_min/max_freq with the
OPP freqs and then the user limts min/max_freq with scaling_min/
max_freq.
Needless to say that this change is a NOP, intended to improve
readability.
Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/devfreq/devfreq.c')
-rw-r--r-- | drivers/devfreq/devfreq.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index e26adf67e218..4c49bb1330b5 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c | |||
@@ -604,21 +604,21 @@ struct devfreq *devfreq_add_device(struct device *dev, | |||
604 | mutex_lock(&devfreq->lock); | 604 | mutex_lock(&devfreq->lock); |
605 | } | 605 | } |
606 | 606 | ||
607 | devfreq->min_freq = find_available_min_freq(devfreq); | 607 | devfreq->scaling_min_freq = find_available_min_freq(devfreq); |
608 | if (!devfreq->min_freq) { | 608 | if (!devfreq->scaling_min_freq) { |
609 | mutex_unlock(&devfreq->lock); | 609 | mutex_unlock(&devfreq->lock); |
610 | err = -EINVAL; | 610 | err = -EINVAL; |
611 | goto err_dev; | 611 | goto err_dev; |
612 | } | 612 | } |
613 | devfreq->scaling_min_freq = devfreq->min_freq; | 613 | devfreq->min_freq = devfreq->scaling_min_freq; |
614 | 614 | ||
615 | devfreq->max_freq = find_available_max_freq(devfreq); | 615 | devfreq->scaling_max_freq = find_available_max_freq(devfreq); |
616 | if (!devfreq->max_freq) { | 616 | if (!devfreq->scaling_max_freq) { |
617 | mutex_unlock(&devfreq->lock); | 617 | mutex_unlock(&devfreq->lock); |
618 | err = -EINVAL; | 618 | err = -EINVAL; |
619 | goto err_dev; | 619 | goto err_dev; |
620 | } | 620 | } |
621 | devfreq->scaling_max_freq = devfreq->max_freq; | 621 | devfreq->max_freq = devfreq->scaling_max_freq; |
622 | 622 | ||
623 | dev_set_name(&devfreq->dev, "devfreq%d", | 623 | dev_set_name(&devfreq->dev, "devfreq%d", |
624 | atomic_inc_return(&devfreq_no)); | 624 | atomic_inc_return(&devfreq_no)); |