struct cpu_hw_events *cpuhw = this_cpu_ptr(&cpu_hw_events);
        struct perf_event *event;
        unsigned long val;
-       int found = 0;
 
        for (i = 0; i < ppmu->n_counter; ++i) {
                event = cpuhw->event[i];
                if ((int)val < 0) {
                        if (event) {
                                /* event has overflowed */
-                               found = 1;
                                record_and_restart(event, val, regs);
                        } else {
                                /*
        isync();
 }
 
-void hw_perf_event_setup(int cpu)
+static int fsl_emb_pmu_prepare_cpu(unsigned int cpu)
 {
        struct cpu_hw_events *cpuhw = &per_cpu(cpu_hw_events, cpu);
 
        memset(cpuhw, 0, sizeof(*cpuhw));
+
+       return 0;
 }
 
 int register_fsl_emb_pmu(struct fsl_emb_pmu *pmu)
                pmu->name);
 
        perf_pmu_register(&fsl_emb_pmu, "cpu", PERF_TYPE_RAW);
+       cpuhp_setup_state(CPUHP_PERF_POWER, "perf/powerpc:prepare",
+                         fsl_emb_pmu_prepare_cpu, NULL);
 
        return 0;
 }