summaryrefslogtreecommitdiffstats
path: root/include/linux/cpuidle.h
diff options
context:
space:
mode:
authorDaniel Lezcano <daniel.lezcano@linaro.org>2013-06-12 09:08:51 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-07-14 20:09:47 -0400
commit728ce22b696f9f1404a74d7b2279a65933553a1b (patch)
tree29b441b10a0e67d937b88f82a1b789ae194f4f20 /include/linux/cpuidle.h
parentf89ae89e2790341587f7132f0552c941342115e9 (diff)
cpuidle: Make cpuidle's sysfs directory dynamically allocated
The cpuidle sysfs code is designed to have a single instance of per CPU cpuidle directory. It is not possible to remove the sysfs entry and create it again. This is not a problem with the current code but future changes will add CPU hotplug support to enable/disable the device, so it will need to remove the sysfs entry like other subsystems do. That won't be possible without this change, because the kobj is a static object which can't be reused for kobj_init_and_add(). Add cpuidle_device_kobj to be allocated dynamically when adding/removing a sysfs entry which is consistent with the other cpuidle's sysfs entries. An added benefit is that the sysfs code is now more self-contained and the includes needed for sysfs can be moved from cpuidle.h directly into sysfs.c so as to reduce the total number of headers dragged along with cpuidle.h. [rjw: Changelog] Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/cpuidle.h')
-rw-r--r--include/linux/cpuidle.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 0bc4b74668e9..b922db53b7ab 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -13,8 +13,6 @@
13 13
14#include <linux/percpu.h> 14#include <linux/percpu.h>
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/kobject.h>
17#include <linux/completion.h>
18#include <linux/hrtimer.h> 16#include <linux/hrtimer.h>
19 17
20#define CPUIDLE_STATE_MAX 10 18#define CPUIDLE_STATE_MAX 10
@@ -61,6 +59,8 @@ struct cpuidle_state {
61 59
62#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000) 60#define CPUIDLE_DRIVER_FLAGS_MASK (0xFFFF0000)
63 61
62struct cpuidle_device_kobj;
63
64struct cpuidle_device { 64struct cpuidle_device {
65 unsigned int registered:1; 65 unsigned int registered:1;
66 unsigned int enabled:1; 66 unsigned int enabled:1;
@@ -71,9 +71,8 @@ struct cpuidle_device {
71 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX]; 71 struct cpuidle_state_usage states_usage[CPUIDLE_STATE_MAX];
72 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX]; 72 struct cpuidle_state_kobj *kobjs[CPUIDLE_STATE_MAX];
73 struct cpuidle_driver_kobj *kobj_driver; 73 struct cpuidle_driver_kobj *kobj_driver;
74 struct cpuidle_device_kobj *kobj_dev;
74 struct list_head device_list; 75 struct list_head device_list;
75 struct kobject kobj;
76 struct completion kobj_unregister;
77 76
78#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED 77#ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED
79 int safe_state_index; 78 int safe_state_index;