]> err.no Git - linux-2.6/blobdiff - arch/arm/oprofile/common.c
[ARM] 4652/1: pxa: fix a typo of pxa27x usb host clk definition
[linux-2.6] / arch / arm / oprofile / common.c
index de72902ad0ca12871522ebb507b71bac314dfa25..a9de727c9327aa29eb266e45860a681e72f1d55c 100644 (file)
@@ -131,16 +131,26 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
        struct op_arm_model_spec *spec = NULL;
        int ret = -ENODEV;
 
+       ops->backtrace = arm_backtrace;
+
 #ifdef CONFIG_CPU_XSCALE
        spec = &op_xscale_spec;
 #endif
 
+#ifdef CONFIG_OPROFILE_ARMV6
+       spec = &op_armv6_spec;
+#endif
+
+#ifdef CONFIG_OPROFILE_MPCORE
+       spec = &op_mpcore_spec;
+#endif
+
        if (spec) {
                ret = spec->init();
                if (ret < 0)
                        return ret;
 
-               counter_config = kmalloc(sizeof(struct op_counter_config) * spec->num_counters,
+               counter_config = kcalloc(spec->num_counters, sizeof(struct op_counter_config),
                                         GFP_KERNEL);
                if (!counter_config)
                        return -ENOMEM;
@@ -153,7 +163,6 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
                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);
        }