aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/sysfs.c
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2010-05-22 16:57:26 -0400
committerLen Brown <len.brown@intel.com>2010-05-27 21:06:58 -0400
commit752138df0dc2daaae09379c754caeb08c97905dc (patch)
tree4908627df11ccb42570fc3525c560f89c444781c /drivers/cpuidle/sysfs.c
parentc0d64cb031c21f163a0ec15cf10844bcf0ceedcf (diff)
cpuidle: make cpuidle_curr_driver static
cpuidle_register_driver() sets cpuidle_curr_driver cpuidle_unregister_driver() clears cpuidle_curr_driver We should't expose cpuidle_curr_driver to potential modification except via these interfaces. So make it static and create cpuidle_get_driver() to observe it. Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/cpuidle/sysfs.c')
-rw-r--r--drivers/cpuidle/sysfs.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index 0ba9c8b8ee74..0310ffaec9df 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -47,10 +47,11 @@ static ssize_t show_current_driver(struct sysdev_class *class,
47 char *buf) 47 char *buf)
48{ 48{
49 ssize_t ret; 49 ssize_t ret;
50 struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver();
50 51
51 spin_lock(&cpuidle_driver_lock); 52 spin_lock(&cpuidle_driver_lock);
52 if (cpuidle_curr_driver) 53 if (cpuidle_driver)
53 ret = sprintf(buf, "%s\n", cpuidle_curr_driver->name); 54 ret = sprintf(buf, "%s\n", cpuidle_driver->name);
54 else 55 else
55 ret = sprintf(buf, "none\n"); 56 ret = sprintf(buf, "none\n");
56 spin_unlock(&cpuidle_driver_lock); 57 spin_unlock(&cpuidle_driver_lock);