summaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq.c
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2016-03-09 11:40:37 +0100
committerLinus Walleij <linus.walleij@linaro.org>2016-03-09 11:40:37 +0100
commit0bae2f17323a4630c487a9b77c37bebf407424af (patch)
treefc1f71a0209ec61841a5acb65d59d147af3cc4fa /drivers/cpufreq/cpufreq.c
parentgpio: mpc8xxx: Slightly update the code for better readability (diff)
parentgpio: tps65912: Add GPIO driver for the TPS65912 PMIC (diff)
downloadlinux-0bae2f17323a4630c487a9b77c37bebf407424af.tar.xz
linux-0bae2f17323a4630c487a9b77c37bebf407424af.zip
Merge branch 'ib-mfd-regulator-gpio-4.6' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into devel
Diffstat (limited to 'drivers/cpufreq/cpufreq.c')
-rw-r--r--drivers/cpufreq/cpufreq.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index c35e7da1ed7a..e979ec78b695 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -48,11 +48,11 @@ static struct cpufreq_policy *next_policy(struct cpufreq_policy *policy,
bool active)
{
do {
- policy = list_next_entry(policy, policy_list);
-
/* No more policies in the list */
- if (&policy->policy_list == &cpufreq_policy_list)
+ if (list_is_last(&policy->policy_list, &cpufreq_policy_list))
return NULL;
+
+ policy = list_next_entry(policy, policy_list);
} while (!suitable_policy(policy, active));
return policy;