summaryrefslogtreecommitdiff
path: root/drivers/devfreq
diff options
context:
space:
mode:
authorTobias Jakobi <tjakobi@math.uni-bielefeld.de>2016-09-29 15:36:36 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2016-10-11 01:01:20 +0300
commitd0563a039c9d35305f4cb2405665130de596d86a (patch)
treef533835dc7c60f982ad13d70333879d011e0664c /drivers/devfreq
parent0f376c9cd86c23f37312d37748b233660ef9d9af (diff)
downloadlinux-d0563a039c9d35305f4cb2405665130de596d86a.tar.xz
PM / devfreq: Skip status update on uninitialized previous_freq
In case devfreq->previous_freq is still uninitialized in devfreq_update_status(), i.e. it has value '0', the lookups in that function fail, eventually leading to some error message: [ 3.041292] devfreq bus_dmc: Couldn't update frequency transition information. Just skip the statup update in this situation. Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r--drivers/devfreq/devfreq.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 66d3c7184a0f..bf3ea7603a58 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -137,6 +137,10 @@ static int devfreq_update_status(struct devfreq *devfreq, unsigned long freq)
cur_time = jiffies;
+ /* Immediately exit if previous_freq is not initialized yet. */
+ if (!devfreq->previous_freq)
+ goto out;
+
prev_lev = devfreq_get_freq_level(devfreq, devfreq->previous_freq);
if (prev_lev < 0) {
ret = prev_lev;