[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>
This commit is contained in:
parent
55f052341f
commit
c6b9dafce3
|
@ -6,6 +6,6 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \
|
||||||
oprofilefs.o oprofile_stats.o \
|
oprofilefs.o oprofile_stats.o \
|
||||||
timer_int.o )
|
timer_int.o )
|
||||||
|
|
||||||
oprofile-y := $(DRIVER_OBJS) init.o backtrace.o
|
oprofile-y := $(DRIVER_OBJS) common.o backtrace.o
|
||||||
oprofile-$(CONFIG_CPU_XSCALE) += common.o op_model_xscale.o
|
oprofile-$(CONFIG_CPU_XSCALE) += op_model_xscale.o
|
||||||
|
|
||||||
|
|
|
@ -125,8 +125,16 @@ static void exit_driverfs(void)
|
||||||
#define exit_driverfs() do { } while (0)
|
#define exit_driverfs() do { } while (0)
|
||||||
#endif /* CONFIG_PM */
|
#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)
|
||||||
{
|
{
|
||||||
|
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);
|
init_MUTEX(&op_arm_sem);
|
||||||
|
|
||||||
if (spec->init() < 0)
|
if (spec->init() < 0)
|
||||||
|
@ -140,12 +148,14 @@ int __init op_arm_init(struct oprofile_operations *ops, struct op_arm_model_spec
|
||||||
ops->start = op_arm_start;
|
ops->start = op_arm_start;
|
||||||
ops->stop = op_arm_stop;
|
ops->stop = op_arm_stop;
|
||||||
ops->cpu_type = op_arm_model->name;
|
ops->cpu_type = op_arm_model->name;
|
||||||
|
ops->backtrace = arm_backtrace;
|
||||||
printk(KERN_INFO "oprofile: using %s\n", spec->name);
|
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) {
|
if (op_arm_model) {
|
||||||
exit_driverfs();
|
exit_driverfs();
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
/**
|
|
||||||
* @file init.c
|
|
||||||
*
|
|
||||||
* @remark Copyright 2004 Oprofile Authors
|
|
||||||
* @remark Read the file COPYING
|
|
||||||
*
|
|
||||||
* @author Zwane Mwaikambo
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <linux/oprofile.h>
|
|
||||||
#include <linux/init.h>
|
|
||||||
#include <linux/errno.h>
|
|
||||||
#include "op_arm_model.h"
|
|
||||||
|
|
||||||
int __init oprofile_arch_init(struct oprofile_operations *ops)
|
|
||||||
{
|
|
||||||
int ret = -ENODEV;
|
|
||||||
|
|
||||||
#ifdef CONFIG_CPU_XSCALE
|
|
||||||
ret = op_arm_init(ops, &op_xscale_spec);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
ops->backtrace = arm_backtrace;
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
void oprofile_arch_exit(void)
|
|
||||||
{
|
|
||||||
#ifdef CONFIG_CPU_XSCALE
|
|
||||||
op_arm_exit();
|
|
||||||
#endif
|
|
||||||
}
|
|
Loading…
Reference in New Issue