aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/oprofile/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/oprofile/common.c')
-rw-r--r--arch/mips/oprofile/common.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c
index 935dd851f480..c31e4cff64e0 100644
--- a/arch/mips/oprofile/common.c
+++ b/arch/mips/oprofile/common.c
@@ -14,8 +14,8 @@
14 14
15#include "op_impl.h" 15#include "op_impl.h"
16 16
17extern struct op_mips_model op_model_mipsxx __attribute__((weak)); 17extern struct op_mips_model op_model_mipsxx_ops __attribute__((weak));
18extern struct op_mips_model op_model_rm9000 __attribute__((weak)); 18extern struct op_mips_model op_model_rm9000_ops __attribute__((weak));
19 19
20static struct op_mips_model *model; 20static struct op_mips_model *model;
21 21
@@ -27,7 +27,7 @@ static int op_mips_setup(void)
27 model->reg_setup(ctr); 27 model->reg_setup(ctr);
28 28
29 /* Configure the registers on all cpus. */ 29 /* Configure the registers on all cpus. */
30 on_each_cpu(model->cpu_setup, 0, 0, 1); 30 on_each_cpu(model->cpu_setup, NULL, 0, 1);
31 31
32 return 0; 32 return 0;
33} 33}
@@ -80,13 +80,14 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
80 case CPU_24K: 80 case CPU_24K:
81 case CPU_25KF: 81 case CPU_25KF:
82 case CPU_34K: 82 case CPU_34K:
83 case CPU_74K:
83 case CPU_SB1: 84 case CPU_SB1:
84 case CPU_SB1A: 85 case CPU_SB1A:
85 lmodel = &op_model_mipsxx; 86 lmodel = &op_model_mipsxx_ops;
86 break; 87 break;
87 88
88 case CPU_RM9000: 89 case CPU_RM9000:
89 lmodel = &op_model_rm9000; 90 lmodel = &op_model_rm9000_ops;
90 break; 91 break;
91 }; 92 };
92 93
@@ -114,5 +115,6 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
114 115
115void oprofile_arch_exit(void) 116void oprofile_arch_exit(void)
116{ 117{
117 model->exit(); 118 if (model)
119 model->exit();
118} 120}