Skip to contentSkip to conversation

x86: prevent /sys/firmware/sgi_uv from being created on non-uv systems

PATCH In review Russ Anderson 1 participant 2 messages Apr 3, 2009 – Apr 8, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86: prevent /sys/firmware/sgi_uv from being created on non-uv systems

/sys/firmware/sgi_uv should only be created on uv systems.

---
The previous patch was an old version.

 arch/x86/kernel/uv_sysfs.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/x86/kernel/uv_sysfs.c +4 -0
Index: linux/arch/x86/kernel/uv_sysfs.c
===================================================================
@@ -21,6 +21,7 @@
 
 #include <linux/sysdev.h>
 #include <asm/uv/bios.h>
+#include <asm/uv/uv.h>
 
 struct kobject *sgi_uv_kobj;
 
@@ -46,6 +47,9 @@ static struct kobj_attribute coherence_i
 static int __init sgi_uv_sysfs_init(void)
 {
 	unsigned long ret;
+
+	if (!is_uv_system())
+		return -ENODEV;
 
 	if (!sgi_uv_kobj)
 		sgi_uv_kobj = kobject_create_and_add("sgi_uv", firmware_kobj);
Signature · 2 lines
Russ Anderson, OS RAS/Partitioning Project Lead  
SGI - Silicon Graphics Inc          [email protected]
#1 lore raw
Commit-ID:  06aa05b307e8efbc278f201198e7cdf3877bc5c2
Gitweb:     http://git.kernel.org/tip/06aa05b307e8efbc278f201198e7cdf3877bc5c2
Author:     Russ Anderson <[email protected]>
AuthorDate: Fri, 3 Apr 2009 17:24:23 -0500
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 8 Apr 2009 14:58:10 +0200

x86: prevent /sys/firmware/sgi_uv from being created on non-uv systems

/sys/firmware/sgi_uv should only be created on uv systems.

LKML-Reference: <[email protected]>

---
 arch/x86/kernel/uv_sysfs.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
arch/x86/kernel/uv_sysfs.c +4 -0
index 67f9b9d..36afb98 100644
@@ -21,6 +21,7 @@
 
 #include <linux/sysdev.h>
 #include <asm/uv/bios.h>
+#include <asm/uv/uv.h>
 
 struct kobject *sgi_uv_kobj;
 
@@ -47,6 +48,9 @@ static int __init sgi_uv_sysfs_init(void)
 {
 	unsigned long ret;
 
+	if (!is_uv_system())
+		return -ENODEV;
+
 	if (!sgi_uv_kobj)
 		sgi_uv_kobj = kobject_create_and_add("sgi_uv", firmware_kobj);
 	if (!sgi_uv_kobj) {