Skip to content

Commit

Permalink
powerpc: Fix bugs introduced by sysfs changes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Benjamin Herrenschmidt committed Mar 27, 2009
1 parent efbda86 commit ec78c8a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions arch/powerpc/kernel/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,17 +134,15 @@ void ppc_enable_pmcs(void)
}
EXPORT_SYMBOL(ppc_enable_pmcs);


#define SYSFS_PMCSETUP(NAME, ADDRESS) \
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(); \
mtspr(ADDRESS, *(unsigned long *)val); \
return 0; \
} \
static ssize_t show_##NAME(struct sys_device *dev, \
struct sysdev_attribute *attr, \
Expand Down

0 comments on commit ec78c8a

Please sign in to comment.