diff options
author | Andi Kleen <andi@firstfloor.org> | 2008-07-01 12:48:41 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-07-22 00:55:02 -0400 |
commit | 4a0b2b4dbe1335b8b9886ba3dc85a145d5d938ed (patch) | |
tree | c2d3a0f86ade5061a1bb9a14aa702323d729fd54 /arch/arm/kernel/time.c | |
parent | 36ce6dad6e3cb3f050ed41e0beac0070d2062b25 (diff) |
sysdev: Pass the attribute to the low level sysdev show/store function
This allow to dynamically generate attributes and share show/store
functions between attributes. Right now most attributes are generated
by special macros and lots of duplicated code. With the attribute
passed it's instead possible to attach some data to the attribute
and then use that in shared low level functions to do different things.
I need this for the dynamically generated bank attributes in the x86
machine check code, but it'll allow some further cleanups.
I converted all users in tree to the new show/store prototype. It's a single
huge patch to avoid unbisectable sections.
Runtime tested: x86-32, x86-64
Compiled only: ia64, powerpc
Not compile tested/only grep converted: sh, arm, avr32
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/arm/kernel/time.c')
-rw-r--r-- | arch/arm/kernel/time.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/kernel/time.c b/arch/arm/kernel/time.c index cc5145b28e7f..368d171754cf 100644 --- a/arch/arm/kernel/time.c +++ b/arch/arm/kernel/time.c | |||
@@ -130,7 +130,9 @@ static const struct leds_evt_name evt_names[] = { | |||
130 | { "red", led_red_on, led_red_off }, | 130 | { "red", led_red_on, led_red_off }, |
131 | }; | 131 | }; |
132 | 132 | ||
133 | static ssize_t leds_store(struct sys_device *dev, const char *buf, size_t size) | 133 | static ssize_t leds_store(struct sys_device *dev, |
134 | struct sysdev_attribute *attr, | ||
135 | const char *buf, size_t size) | ||
134 | { | 136 | { |
135 | int ret = -EINVAL, len = strcspn(buf, " "); | 137 | int ret = -EINVAL, len = strcspn(buf, " "); |
136 | 138 | ||