summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGaurav Jindal <gauravjindal1104@gmail.com>2017-09-01 17:07:26 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-11-08 23:09:52 +0100
commite7b06a09e7d87ec0d6d8b17eec50fbb93667eee1 (patch)
tree4c832a76f6d395b434f73409fd1c6ac4751b3680
parentcpuidle: ladder: Add per CPU PM QoS resume latency support (diff)
downloadlinux-e7b06a09e7d87ec0d6d8b17eec50fbb93667eee1.tar.xz
linux-e7b06a09e7d87ec0d6d8b17eec50fbb93667eee1.zip
cpuidle: Clean up cpuidle_enable_device() error handling a bit
Do not fetch per CPU drv if cpuidle_curr_governor is NULL to avoid useless per CPU processing. Signed-off-by: Gaurav Jindal <gauravjindal1104@gmail.com> [ rjw: Subject & changelog ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/cpuidle/cpuidle.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index ed4df58a855e..27f9648b61c2 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -388,9 +388,12 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
if (dev->enabled)
return 0;
+ if (!cpuidle_curr_governor)
+ return -EIO;
+
drv = cpuidle_get_cpu_driver(dev);
- if (!drv || !cpuidle_curr_governor)
+ if (!drv)
return -EIO;
if (!dev->registered)