summaryrefslogtreecommitdiff
path: root/drivers/cpuidle
diff options
context:
space:
mode:
authorJoao Martins <joao.m.martins@oracle.com>2019-09-08 02:45:23 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2019-09-11 18:36:30 +0300
commit5cc59f597c0666c6a7e1c67aac9063895949fd56 (patch)
treed1acceb96df708a0935b4a8a33b52b843b41c1d5 /drivers/cpuidle
parent7321440829a27d58c88b7fcfcbbc37487b5e39a5 (diff)
downloadlinux-5cc59f597c0666c6a7e1c67aac9063895949fd56.tar.xz
cpuidle-haltpoll: return -ENODEV on modinit failure
When a user loads cpuidle-haltpoll on a non KVM guest the module will successfully load, even though idle driver registration didn't take place. We should instead return -ENODEV signaling the user that the driver can't be loaded, like other error paths in haltpoll_init(). An example of such error paths is when we return -EBUSY when attempting to register an idle driver when it had one already (e.g. intel_idle loads at boot and then we attempt to insert module cpuidle-haltpoll). Fixes: fa86ee90eb11 ("add cpuidle-haltpoll driver") Signed-off-by: Joao Martins <joao.m.martins@oracle.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpuidle')
-rw-r--r--drivers/cpuidle/cpuidle-haltpoll.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/cpuidle/cpuidle-haltpoll.c b/drivers/cpuidle/cpuidle-haltpoll.c
index 519e90d125cf..7a0239ef717e 100644
--- a/drivers/cpuidle/cpuidle-haltpoll.c
+++ b/drivers/cpuidle/cpuidle-haltpoll.c
@@ -99,7 +99,7 @@ static int __init haltpoll_init(void)
cpuidle_poll_state_init(drv);
if (!kvm_para_available())
- return 0;
+ return -ENODEV;
ret = cpuidle_register_driver(drv);
if (ret < 0)