diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-03-26 15:29:06 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2009-03-27 01:58:24 -0400 |
commit | ec78c8ac16e7a5f45e21838ab2f5573200bfcdd3 (patch) | |
tree | 58281a386f6a3517c68765cdac49d36996b19275 /arch/powerpc/kernel | |
parent | efbda86098455da014be849713df6498cefc5a2a (diff) |
powerpc: Fix bugs introduced by sysfs changes
Rusty's patch to change our sysfs access to various registers
to use smp_call_function_single() introduced a whole bunch of
warnings. This fixes them. This version also fixes an actual
bug in here where it did mtspr instead of mfspr when reading
the files
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/sysfs.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index e6cd6c990c25..f41aec85aa49 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c | |||
@@ -134,17 +134,15 @@ void ppc_enable_pmcs(void) | |||
134 | } | 134 | } |
135 | EXPORT_SYMBOL(ppc_enable_pmcs); | 135 | EXPORT_SYMBOL(ppc_enable_pmcs); |
136 | 136 | ||
137 | |||
138 | #define SYSFS_PMCSETUP(NAME, ADDRESS) \ | 137 | #define SYSFS_PMCSETUP(NAME, ADDRESS) \ |
139 | static void read_##NAME(void *val) \ | 138 | static void read_##NAME(void *val) \ |
140 | { \ | 139 | { \ |
141 | mtspr(ADDRESS, *(unsigned long *)val); \ | 140 | *(unsigned long *)val = mfspr(ADDRESS); \ |
142 | } \ | 141 | } \ |
143 | static unsigned long write_##NAME(unsigned long val) \ | 142 | static void write_##NAME(void *val) \ |
144 | { \ | 143 | { \ |
145 | ppc_enable_pmcs(); \ | 144 | ppc_enable_pmcs(); \ |
146 | mtspr(ADDRESS, *(unsigned long *)val); \ | 145 | mtspr(ADDRESS, *(unsigned long *)val); \ |
147 | return 0; \ | ||
148 | } \ | 146 | } \ |
149 | static ssize_t show_##NAME(struct sys_device *dev, \ | 147 | static ssize_t show_##NAME(struct sys_device *dev, \ |
150 | struct sysdev_attribute *attr, \ | 148 | struct sysdev_attribute *attr, \ |