Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpuidle-haltpoll: do not set an owner to allow modunload

cpuidle-haltpoll can be built as a module to allow optional late load.
Given we are setting @owner to THIS_MODULE, cpuidle will attempt to grab a
module reference every time a cpuidle_device is registered -- so
essentially all online cpus get a reference.

This prevents for the module to be unloaded later, which makes the
module_exit callback entirely unused. Thus remove the @owner and allow
module to be unloaded.

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>

authored by

Joao Martins and committed by
Rafael J. Wysocki
472f2636 5cc59f59

-1
-1
drivers/cpuidle/cpuidle-haltpoll.c
··· 35 35 static struct cpuidle_driver haltpoll_driver = { 36 36 .name = "haltpoll", 37 37 .governor = "haltpoll", 38 - .owner = THIS_MODULE, 39 38 .states = { 40 39 { /* entry 0 is for polling */ }, 41 40 {