diff options
author | Len Brown <len.brown@intel.com> | 2010-05-23 00:57:26 +0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2010-05-28 05:06:58 +0400 |
commit | 752138df0dc2daaae09379c754caeb08c97905dc (patch) | |
tree | 4908627df11ccb42570fc3525c560f89c444781c /drivers/cpuidle/sysfs.c | |
parent | c0d64cb031c21f163a0ec15cf10844bcf0ceedcf (diff) | |
download | linux-752138df0dc2daaae09379c754caeb08c97905dc.tar.xz |
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.c | 5 |
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, char *buf) { ssize_t ret; + struct cpuidle_driver *cpuidle_driver = cpuidle_get_driver(); spin_lock(&cpuidle_driver_lock); - if (cpuidle_curr_driver) - ret = sprintf(buf, "%s\n", cpuidle_curr_driver->name); + if (cpuidle_driver) + ret = sprintf(buf, "%s\n", cpuidle_driver->name); else ret = sprintf(buf, "none\n"); spin_unlock(&cpuidle_driver_lock); |