109 lines
3.3 KiB
Diff
109 lines
3.3 KiB
Diff
From 6d3cbf9a4549928be8ed15cf6a3576c217723895 Mon Sep 17 00:00:00 2001
|
|
From: Nicolas DET <nd@bplan-gmbh.de>
|
|
Date: Fri, 24 Nov 2006 13:22:22 +0100
|
|
Subject: [PATCH] Added RTAS support for 32bit PowerPC
|
|
|
|
Signed-off-by: Nicolas DET <nd@bplan-gmbh.de>
|
|
---
|
|
arch/powerpc/kernel/proc_ppc64.c | 9 ---------
|
|
arch/powerpc/kernel/rtas-proc.c | 36 ++++++++++++++++++++++++++----------
|
|
2 files changed, 26 insertions(+), 19 deletions(-)
|
|
|
|
diff --git a/arch/powerpc/kernel/proc_ppc64.c b/arch/powerpc/kernel/proc_ppc64.c
|
|
index f598cb5..9b9c32d 100644
|
|
--- a/arch/powerpc/kernel/proc_ppc64.c
|
|
+++ b/arch/powerpc/kernel/proc_ppc64.c
|
|
@@ -51,15 +51,6 @@ static int __init proc_ppc64_create(void
|
|
if (!root)
|
|
return 1;
|
|
|
|
- if (!of_find_node_by_path("/rtas"))
|
|
- return 0;
|
|
-
|
|
- if (!proc_mkdir("rtas", root))
|
|
- return 1;
|
|
-
|
|
- if (!proc_symlink("rtas", NULL, "ppc64/rtas"))
|
|
- return 1;
|
|
-
|
|
return 0;
|
|
}
|
|
core_initcall(proc_ppc64_create);
|
|
diff --git a/arch/powerpc/kernel/rtas-proc.c b/arch/powerpc/kernel/rtas-proc.c
|
|
index 2fe82ab..4c06c32 100644
|
|
--- a/arch/powerpc/kernel/rtas-proc.c
|
|
+++ b/arch/powerpc/kernel/rtas-proc.c
|
|
@@ -253,43 +253,59 @@ static void get_location_code(struct seq
|
|
static void check_location_string(struct seq_file *m, const char *c);
|
|
static void check_location(struct seq_file *m, const char *c);
|
|
|
|
+static int __init proc_rtas_create(void)
|
|
+{
|
|
+ struct proc_dir_entry *root;
|
|
+
|
|
+ root = proc_mkdir("rtas" , NULL);
|
|
+ if (!root)
|
|
+ return -1;
|
|
+
|
|
+#ifdef CONFIG_PPC64
|
|
+ if (!proc_symlink("rtas", NULL, "ppc64/rtas"))
|
|
+ return -1;
|
|
+#endif
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static int __init proc_rtas_init(void)
|
|
{
|
|
struct proc_dir_entry *entry;
|
|
|
|
- if (!machine_is(pseries))
|
|
- return -ENODEV;
|
|
-
|
|
rtas_node = of_find_node_by_name(NULL, "rtas");
|
|
if (rtas_node == NULL)
|
|
return -ENODEV;
|
|
|
|
- entry = create_proc_entry("ppc64/rtas/progress", S_IRUGO|S_IWUSR, NULL);
|
|
+ if (proc_rtas_create() != 0)
|
|
+ return -ENODEV;
|
|
+
|
|
+ entry = create_proc_entry("rtas/progress", S_IRUGO|S_IWUSR, NULL);
|
|
if (entry)
|
|
entry->proc_fops = &ppc_rtas_progress_operations;
|
|
|
|
- entry = create_proc_entry("ppc64/rtas/clock", S_IRUGO|S_IWUSR, NULL);
|
|
+ entry = create_proc_entry("rtas/clock", S_IRUGO|S_IWUSR, NULL);
|
|
if (entry)
|
|
entry->proc_fops = &ppc_rtas_clock_operations;
|
|
|
|
- entry = create_proc_entry("ppc64/rtas/poweron", S_IWUSR|S_IRUGO, NULL);
|
|
+ entry = create_proc_entry("rtas/poweron", S_IWUSR|S_IRUGO, NULL);
|
|
if (entry)
|
|
entry->proc_fops = &ppc_rtas_poweron_operations;
|
|
|
|
- entry = create_proc_entry("ppc64/rtas/sensors", S_IRUGO, NULL);
|
|
+ entry = create_proc_entry("rtas/sensors", S_IRUGO, NULL);
|
|
if (entry)
|
|
entry->proc_fops = &ppc_rtas_sensors_operations;
|
|
|
|
- entry = create_proc_entry("ppc64/rtas/frequency", S_IWUSR|S_IRUGO,
|
|
+ entry = create_proc_entry("rtas/frequency", S_IWUSR|S_IRUGO,
|
|
NULL);
|
|
if (entry)
|
|
entry->proc_fops = &ppc_rtas_tone_freq_operations;
|
|
|
|
- entry = create_proc_entry("ppc64/rtas/volume", S_IWUSR|S_IRUGO, NULL);
|
|
+ entry = create_proc_entry("rtas/volume", S_IWUSR|S_IRUGO, NULL);
|
|
if (entry)
|
|
entry->proc_fops = &ppc_rtas_tone_volume_operations;
|
|
|
|
- entry = create_proc_entry("ppc64/rtas/rmo_buffer", S_IRUSR, NULL);
|
|
+ entry = create_proc_entry("rtas/rmo_buffer", S_IRUSR, NULL);
|
|
if (entry)
|
|
entry->proc_fops = &ppc_rtas_rmo_buf_ops;
|
|
|
|
--
|
|
1.4.3.2
|
|
|