summaryrefslogtreecommitdiff
path: root/arch/arm/oprofile/common.c
diff options
context:
space:
mode:
authorRussell King <rmk@dyn-67.arm.linux.org.uk>2005-10-28 17:56:04 +0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-10-28 17:56:04 +0400
commitc6b9dafce3e3b434a3e7ffd5072815c03d18cc84 (patch)
tree111b89d53b0d66d1220d20aaa37f9dbd29658ab4 /arch/arm/oprofile/common.c
parent55f052341ff75e5815b1f7f4d2d3b69314ea8712 (diff)
downloadlinux-c6b9dafce3e3b434a3e7ffd5072815c03d18cc84.tar.xz
[ARM] 4/4 Combine oprofile common and init code
There is nothing special about having the init code separate from the common code, so combine the two. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/oprofile/common.c')
-rw-r--r--arch/arm/oprofile/common.c44
1 files changed, 27 insertions, 17 deletions
diff --git a/arch/arm/oprofile/common.c b/arch/arm/oprofile/common.c
index 7ce6dfa06c85..1415930ceee1 100644
--- a/arch/arm/oprofile/common.c
+++ b/arch/arm/oprofile/common.c
@@ -125,27 +125,37 @@ static void exit_driverfs(void)
#define exit_driverfs() do { } while (0)
#endif /* CONFIG_PM */
-int __init op_arm_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec)
+int __init oprofile_arch_init(struct oprofile_operations *ops)
{
- init_MUTEX(&op_arm_sem);
-
- if (spec->init() < 0)
- return -ENODEV;
-
- op_arm_model = spec;
- init_driverfs();
- ops->create_files = op_arm_create_files;
- ops->setup = op_arm_setup;
- ops->shutdown = op_arm_stop;
- ops->start = op_arm_start;
- ops->stop = op_arm_stop;
- ops->cpu_type = op_arm_model->name;
- printk(KERN_INFO "oprofile: using %s\n", spec->name);
+ struct op_arm_model_spec *spec = NULL;
+ int ret = -ENODEV;
+
+#ifdef CONFIG_CPU_XSCALE
+ spec = &op_xscale_spec;
+#endif
+
+ if (spec) {
+ init_MUTEX(&op_arm_sem);
+
+ if (spec->init() < 0)
+ return -ENODEV;
+
+ op_arm_model = spec;
+ init_driverfs();
+ ops->create_files = op_arm_create_files;
+ ops->setup = op_arm_setup;
+ ops->shutdown = op_arm_stop;
+ ops->start = op_arm_start;
+ ops->stop = op_arm_stop;
+ ops->cpu_type = op_arm_model->name;
+ ops->backtrace = arm_backtrace;
+ printk(KERN_INFO "oprofile: using %s\n", spec->name);
+ }
- return 0;
+ return ret;
}
-void op_arm_exit(void)
+void oprofile_arch_exit(void)
{
if (op_arm_model) {
exit_driverfs();