From: Benjamin Herrenschmidt Date: Thu, 26 Mar 2009 19:29:06 +0000 (+0000) Subject: powerpc: Fix bugs introduced by sysfs changes X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ec78c8ac16e7a5f45e21838ab2f5573200bfcdd3;p=linux-2.6-omap-h63xx.git 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 --- diff --git a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c index e6cd6c990c2..f41aec85aa4 100644 --- a/arch/powerpc/kernel/sysfs.c +++ b/arch/powerpc/kernel/sysfs.c @@ -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, \