diff options
author | Anton Blanchard <anton@samba.org> | 2006-01-08 23:41:31 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-01-09 00:02:52 -0500 |
commit | 32a33994d513606d29e87e152deb67ba5f3c8e82 (patch) | |
tree | 2966bbe85eb2880aacc1dba045af7a02cee0aa26 /arch/powerpc/oprofile | |
parent | 9a699aefa87cb0379a67741926820c9271d748a9 (diff) |
[PATCH] ppc64: Fix oprofile when compiled as a module
My recent changes to oprofile broke it when built as a module. Fix it by
using an enum instead of a function pointer. This way we still retain
the oprofile configuration in the cputable.
Signed-off-by: Anton Blanchard <anton@samba.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/oprofile')
-rw-r--r-- | arch/powerpc/oprofile/common.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/arch/powerpc/oprofile/common.c b/arch/powerpc/oprofile/common.c index a370778b68dd..71615eb70b2b 100644 --- a/arch/powerpc/oprofile/common.c +++ b/arch/powerpc/oprofile/common.c | |||
@@ -135,9 +135,31 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root) | |||
135 | 135 | ||
136 | int __init oprofile_arch_init(struct oprofile_operations *ops) | 136 | int __init oprofile_arch_init(struct oprofile_operations *ops) |
137 | { | 137 | { |
138 | if (!cur_cpu_spec->oprofile_model || !cur_cpu_spec->oprofile_cpu_type) | 138 | if (!cur_cpu_spec->oprofile_cpu_type) |
139 | return -ENODEV; | 139 | return -ENODEV; |
140 | model = cur_cpu_spec->oprofile_model; | 140 | |
141 | switch (cur_cpu_spec->oprofile_type) { | ||
142 | #ifdef CONFIG_PPC64 | ||
143 | case RS64: | ||
144 | model = &op_model_rs64; | ||
145 | break; | ||
146 | case POWER4: | ||
147 | model = &op_model_power4; | ||
148 | break; | ||
149 | #else | ||
150 | case G4: | ||
151 | model = &op_model_7450; | ||
152 | break; | ||
153 | #endif | ||
154 | #ifdef CONFIG_FSL_BOOKE | ||
155 | case BOOKE: | ||
156 | model = &op_model_fsl_booke; | ||
157 | break; | ||
158 | #endif | ||
159 | default: | ||
160 | return -ENODEV; | ||
161 | } | ||
162 | |||
141 | model->num_counters = cur_cpu_spec->num_pmcs; | 163 | model->num_counters = cur_cpu_spec->num_pmcs; |
142 | 164 | ||
143 | ops->cpu_type = cur_cpu_spec->oprofile_cpu_type; | 165 | ops->cpu_type = cur_cpu_spec->oprofile_cpu_type; |