summaryrefslogtreecommitdiffstats
path: root/drivers/cpuidle/sysfs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-15 06:29:46 +0100
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-15 06:29:46 +0100
commit4e3d0319451805cffa69bdb1352f1c9817bf28bc (patch)
treeec9426300d73f742d7487142ca1a57ef806002bc /drivers/cpuidle/sysfs.c
parentMerge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 (diff)
parentMerge branches 'release', 'dmi', 'idle' and 'misc' into release (diff)
downloadlinux-4e3d0319451805cffa69bdb1352f1c9817bf28bc.tar.xz
linux-4e3d0319451805cffa69bdb1352f1c9817bf28bc.zip
Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: ACPI: DMI: quirk for FSC ESPRIMO Mobile V5505 ACPI: DMI blacklist updates pnpacpi: __initdata is not an identifier ACPI: static acpi_chain_head ACPI: static acpi_find_dsdt_initrd() ACPI: static acpi_no_initrd_override_setup() thinkpad_acpi: static ACPI suspend: Execute _WAK with the right argument cpuidle: Add Documentation ACPI, cpuidle: Clarify C-state description in sysfs ACPI: fix suspend regression due to idle update
Diffstat (limited to 'drivers/cpuidle/sysfs.c')
-rw-r--r--drivers/cpuidle/sysfs.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index 088ea74edd34..69102ca05685 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -218,16 +218,23 @@ static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
return sprintf(buf, "%u\n", state->_name);\
}
-static ssize_t show_state_name(struct cpuidle_state *state, char *buf)
-{
- return sprintf(buf, "%s\n", state->name);
+#define define_show_state_str_function(_name) \
+static ssize_t show_state_##_name(struct cpuidle_state *state, char *buf) \
+{ \
+ if (state->_name[0] == '\0')\
+ return sprintf(buf, "<null>\n");\
+ return sprintf(buf, "%s\n", state->_name);\
}
define_show_state_function(exit_latency)
define_show_state_function(power_usage)
define_show_state_function(usage)
define_show_state_function(time)
+define_show_state_str_function(name)
+define_show_state_str_function(desc)
+
define_one_state_ro(name, show_state_name);
+define_one_state_ro(desc, show_state_desc);
define_one_state_ro(latency, show_state_exit_latency);
define_one_state_ro(power, show_state_power_usage);
define_one_state_ro(usage, show_state_usage);
@@ -235,6 +242,7 @@ define_one_state_ro(time, show_state_time);
static struct attribute *cpuidle_state_default_attrs[] = {
&attr_name.attr,
+ &attr_desc.attr,
&attr_latency.attr,
&attr_power.attr,
&attr_usage.attr,