diff options
author | Li RongQing <lirongqing@baidu.com> | 2022-03-04 08:53:28 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2022-03-09 19:59:45 +0100 |
commit | 659b66e98bb38dc6300dca3c9ebebeba194b575b (patch) | |
tree | ec05415a1c70b8b54a3933ce2b9af96f81f266c5 /drivers/cpuidle | |
parent | intel_idle: add core C6 optimization for SPR (diff) | |
download | linux-659b66e98bb38dc6300dca3c9ebebeba194b575b.tar.xz linux-659b66e98bb38dc6300dca3c9ebebeba194b575b.zip |
cpuidle: haltpoll: Call cpuidle_poll_state_init() later
Call cpuidle_poll_state_init() only if it is needed to avoid doing
useless work.
Signed-off-by: Li RongQing <lirongqing@baidu.com>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r-- | drivers/cpuidle/cpuidle-haltpoll.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c index fcc53215bac8..3a39a7f48b77 100644 --- a/drivers/cpuidle/cpuidle-haltpoll.c +++ b/drivers/cpuidle/cpuidle-haltpoll.c @@ -108,11 +108,11 @@ static int __init haltpoll_init(void) if (boot_option_idle_override != IDLE_NO_OVERRIDE) return -ENODEV; - cpuidle_poll_state_init(drv); - if (!kvm_para_available() || !haltpoll_want()) return -ENODEV; + cpuidle_poll_state_init(drv); + ret = cpuidle_register_driver(drv); if (ret < 0) return ret; |