Commit e5f1b245 authored by Daniel Lezcano's avatar Daniel Lezcano Committed by Rafael J. Wysocki

cpuidle: governors: Remove remaining old module code

The governor's code use try_module_get() and put_module() to refcount
the governor's module. But the governors are not compiled as module.

The refcount does not prevent to switch the governor or unload
a module as they aren't compiled as modules. The code is pointless,
so remove it.
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 1001354c
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
*/ */
#include <linux/mutex.h> #include <linux/mutex.h>
#include <linux/module.h>
#include <linux/cpuidle.h> #include <linux/cpuidle.h>
#include "cpuidle.h" #include "cpuidle.h"
...@@ -53,14 +52,11 @@ int cpuidle_switch_governor(struct cpuidle_governor *gov) ...@@ -53,14 +52,11 @@ int cpuidle_switch_governor(struct cpuidle_governor *gov)
if (cpuidle_curr_governor) { if (cpuidle_curr_governor) {
list_for_each_entry(dev, &cpuidle_detected_devices, device_list) list_for_each_entry(dev, &cpuidle_detected_devices, device_list)
cpuidle_disable_device(dev); cpuidle_disable_device(dev);
module_put(cpuidle_curr_governor->owner);
} }
cpuidle_curr_governor = gov; cpuidle_curr_governor = gov;
if (gov) { if (gov) {
if (!try_module_get(cpuidle_curr_governor->owner))
return -EINVAL;
list_for_each_entry(dev, &cpuidle_detected_devices, device_list) list_for_each_entry(dev, &cpuidle_detected_devices, device_list)
cpuidle_enable_device(dev); cpuidle_enable_device(dev);
cpuidle_install_idle_handler(); cpuidle_install_idle_handler();
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/cpuidle.h> #include <linux/cpuidle.h>
#include <linux/pm_qos.h> #include <linux/pm_qos.h>
#include <linux/module.h>
#include <linux/jiffies.h> #include <linux/jiffies.h>
#include <linux/tick.h> #include <linux/tick.h>
...@@ -177,7 +176,6 @@ static struct cpuidle_governor ladder_governor = { ...@@ -177,7 +176,6 @@ static struct cpuidle_governor ladder_governor = {
.enable = ladder_enable_device, .enable = ladder_enable_device,
.select = ladder_select_state, .select = ladder_select_state,
.reflect = ladder_reflect, .reflect = ladder_reflect,
.owner = THIS_MODULE,
}; };
/** /**
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include <linux/tick.h> #include <linux/tick.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/math64.h> #include <linux/math64.h>
#include <linux/module.h>
/* /*
* Please note when changing the tuning values: * Please note when changing the tuning values:
...@@ -484,7 +483,6 @@ static struct cpuidle_governor menu_governor = { ...@@ -484,7 +483,6 @@ static struct cpuidle_governor menu_governor = {
.enable = menu_enable_device, .enable = menu_enable_device,
.select = menu_select, .select = menu_select,
.reflect = menu_reflect, .reflect = menu_reflect,
.owner = THIS_MODULE,
}; };
/** /**
......
...@@ -235,8 +235,6 @@ struct cpuidle_governor { ...@@ -235,8 +235,6 @@ struct cpuidle_governor {
int (*select) (struct cpuidle_driver *drv, int (*select) (struct cpuidle_driver *drv,
struct cpuidle_device *dev); struct cpuidle_device *dev);
void (*reflect) (struct cpuidle_device *dev, int index); void (*reflect) (struct cpuidle_device *dev, int index);
struct module *owner;
}; };
#ifdef CONFIG_CPU_IDLE #ifdef CONFIG_CPU_IDLE
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment