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: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent efbda860
...@@ -134,17 +134,15 @@ void ppc_enable_pmcs(void) ...@@ -134,17 +134,15 @@ void ppc_enable_pmcs(void)
} }
EXPORT_SYMBOL(ppc_enable_pmcs); EXPORT_SYMBOL(ppc_enable_pmcs);
#define SYSFS_PMCSETUP(NAME, ADDRESS) \ #define SYSFS_PMCSETUP(NAME, ADDRESS) \
static void read_##NAME(void *val) \ static void read_##NAME(void *val) \
{ \ { \
mtspr(ADDRESS, *(unsigned long *)val); \ *(unsigned long *)val = mfspr(ADDRESS); \
} \ } \
static unsigned long write_##NAME(unsigned long val) \ static void write_##NAME(void *val) \
{ \ { \
ppc_enable_pmcs(); \ ppc_enable_pmcs(); \
mtspr(ADDRESS, *(unsigned long *)val); \ mtspr(ADDRESS, *(unsigned long *)val); \
return 0; \
} \ } \
static ssize_t show_##NAME(struct sys_device *dev, \ static ssize_t show_##NAME(struct sys_device *dev, \
struct sysdev_attribute *attr, \ struct sysdev_attribute *attr, \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment