[RFC/PATCH 12/12] powerpc: Use FW_FEATURE_ISERIES in sysfs.c

Michael Ellerman michael at ellerman.id.au
Tue Jan 17 14:22:51 EST 2006


Use a firmware feature test in sysfs.c

 arch/powerpc/kernel/sysfs.c |   13 ++++---------
 1 files changed, 4 insertions(+), 9 deletions(-)

Index: linux/arch/powerpc/kernel/sysfs.c
===================================================================
--- linux.orig/arch/powerpc/kernel/sysfs.c
+++ linux/arch/powerpc/kernel/sysfs.c
@@ -25,7 +25,6 @@ static DEFINE_PER_CPU(struct cpu, cpu_de
 
 /* SMT stuff */
 
-#ifdef CONFIG_PPC_MULTIPLATFORM
 /* default to snooze disabled */
 DEFINE_PER_CPU(unsigned long, smt_snooze_delay);
 
@@ -101,8 +100,6 @@ static int __init setup_smt_snooze_delay
 }
 __setup("smt-snooze-delay=", setup_smt_snooze_delay);
 
-#endif /* CONFIG_PPC_MULTIPLATFORM */
-
 /*
  * Enabling PMCs will slow partition context switch times so we only do
  * it the first time we write to the PMCs.
@@ -202,10 +199,9 @@ static void register_cpu_online(unsigned
 	struct cpu *c = &per_cpu(cpu_devices, cpu);
 	struct sys_device *s = &c->sysdev;
 
-#ifndef CONFIG_PPC_ISERIES
-	if (cpu_has_feature(CPU_FTR_SMT))
+	if (!firmware_has_feature(FW_FEATURE_ISERIES) &&
+			cpu_has_feature(CPU_FTR_SMT))
 		sysdev_create_file(s, &attr_smt_snooze_delay);
-#endif
 
 	/* PMC stuff */
 
@@ -244,10 +240,9 @@ static void unregister_cpu_online(unsign
 
 	BUG_ON(c->no_control);
 
-#ifndef CONFIG_PPC_ISERIES
-	if (cpu_has_feature(CPU_FTR_SMT))
+	if (!firmware_has_feature(FW_FEATURE_ISERIES) &&
+			cpu_has_feature(CPU_FTR_SMT))
 		sysdev_remove_file(s, &attr_smt_snooze_delay);
-#endif
 
 	/* PMC stuff */
 



More information about the Linuxppc64-dev mailing list