Merge by hand from Linus' tree.
[linux-2.6.git] / arch / powerpc / oprofile / common.c
index 486314a0defd0a250057354c90e43ca55dabf711..0ec12c8f2c01237ac73a02b41944a10318b8308a 100644 (file)
@@ -46,19 +46,12 @@ static void op_handle_interrupt(struct pt_regs *regs)
 
 static int op_powerpc_setup(void)
 {
-#ifdef __powerpc64__
        int err;
 
        /* Grab the hardware */
        err = reserve_pmc_hardware(op_handle_interrupt);
        if (err)
                return err;
-#else /* __powerpc64__ */
-       /* Install our interrupt handler into the existing hook.  */
-       if (request_perfmon_irq(&op_handle_interrupt))
-               return -EBUSY;
-       mb();
-#endif /* __powerpc64__ */
 
        /* Pre-compute the values to stuff in the hardware registers.  */
        model->reg_setup(ctr, &sys, model->num_counters);
@@ -78,13 +71,7 @@ static int op_powerpc_setup(void)
 
 static void op_powerpc_shutdown(void)
 {
-#ifdef __powerpc64__
        release_pmc_hardware();
-#else /* __powerpc64__ */
-       mb();
-       /* Remove our interrupt handler. We may be removing this module. */
-       free_perfmon_irq();
-#endif /* __powerpc64__ */
 }
 
 static void op_powerpc_cpu_start(void *dummy)
@@ -168,8 +155,6 @@ static int op_powerpc_create_files(struct super_block *sb, struct dentry *root)
 int __init oprofile_arch_init(struct oprofile_operations *ops)
 {
 #ifndef __powerpc64__
-       int cpu_id = smp_processor_id();
-
 #ifdef CONFIG_FSL_BOOKE
        model = &op_model_fsl_booke;
 #else
@@ -180,9 +165,9 @@ int __init oprofile_arch_init(struct oprofile_operations *ops)
        if (NULL == cpu_type)
                return -ENOMEM;
 
-       sprintf(cpu_type, "ppc/%s", cur_cpu_spec[cpu_id]->cpu_name);
+       sprintf(cpu_type, "ppc/%s", cur_cpu_spec->cpu_name);
 
-       model->num_counters = cur_cpu_spec[cpu_id]->num_pmcs;
+       model->num_counters = cur_cpu_spec->num_pmcs;
 
        ops->cpu_type = cpu_type;
 #else /* __powerpc64__ */