diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2005-10-28 09:56:04 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-10-28 09:56:04 -0400 |
commit | c6b9dafce3e3b434a3e7ffd5072815c03d18cc84 (patch) | |
tree | 111b89d53b0d66d1220d20aaa37f9dbd29658ab4 /arch/arm/oprofile/common.c | |
parent | 55f052341ff75e5815b1f7f4d2d3b69314ea8712 (diff) |
[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.c | 44 |
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) | |||
125 | #define exit_driverfs() do { } while (0) | 125 | #define exit_driverfs() do { } while (0) |
126 | #endif /* CONFIG_PM */ | 126 | #endif /* CONFIG_PM */ |
127 | 127 | ||
128 | int __init op_arm_init(struct oprofile_operations *ops, struct op_arm_model_spec *spec) | 128 | int __init oprofile_arch_init(struct oprofile_operations *ops) |
129 | { | 129 | { |
130 | init_MUTEX(&op_arm_sem); | 130 | struct op_arm_model_spec *spec = NULL; |
131 | 131 | int ret = -ENODEV; | |
132 | if (spec->init() < 0) | 132 | |
133 | return -ENODEV; | 133 | #ifdef CONFIG_CPU_XSCALE |
134 | 134 | spec = &op_xscale_spec; | |
135 | op_arm_model = spec; | 135 | #endif |
136 | init_driverfs(); | 136 | |
137 | ops->create_files = op_arm_create_files; | 137 | if (spec) { |
138 | ops->setup = op_arm_setup; | 138 | init_MUTEX(&op_arm_sem); |
139 | ops->shutdown = op_arm_stop; | 139 | |
140 | ops->start = op_arm_start; | 140 | if (spec->init() < 0) |
141 | ops->stop = op_arm_stop; | 141 | return -ENODEV; |
142 | ops->cpu_type = op_arm_model->name; | 142 | |
143 | printk(KERN_INFO "oprofile: using %s\n", spec->name); | 143 | op_arm_model = spec; |
144 | init_driverfs(); | ||
145 | ops->create_files = op_arm_create_files; | ||
146 | ops->setup = op_arm_setup; | ||
147 | ops->shutdown = op_arm_stop; | ||
148 | ops->start = op_arm_start; | ||
149 | ops->stop = op_arm_stop; | ||
150 | ops->cpu_type = op_arm_model->name; | ||
151 | ops->backtrace = arm_backtrace; | ||
152 | printk(KERN_INFO "oprofile: using %s\n", spec->name); | ||
153 | } | ||
144 | 154 | ||
145 | return 0; | 155 | return ret; |
146 | } | 156 | } |
147 | 157 | ||
148 | void op_arm_exit(void) | 158 | void oprofile_arch_exit(void) |
149 | { | 159 | { |
150 | if (op_arm_model) { | 160 | if (op_arm_model) { |
151 | exit_driverfs(); | 161 | exit_driverfs(); |