diff options
author | Gaurav Jindal <gauravjindal1104@gmail.com> | 2017-09-01 18:07:26 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2017-11-09 01:09:52 +0300 |
commit | e7b06a09e7d87ec0d6d8b17eec50fbb93667eee1 (patch) | |
tree | 4c832a76f6d395b434f73409fd1c6ac4751b3680 | |
parent | c523c68da2117a3f9f777110839b1cf7ed7221be (diff) | |
download | linux-e7b06a09e7d87ec0d6d8b17eec50fbb93667eee1.tar.xz |
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.c | 5 |
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) |