perf: Register PMU implementations
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / powerpc / kernel / power4-pmu.c
index db90b0c5c27bbc05f9d66dc8a70c18f108e9ecf3..2a361cdda635881ba4e96bf33f0a3dd6b8c273ea 100644 (file)
@@ -9,7 +9,7 @@
  * 2 of the License, or (at your option) any later version.
  */
 #include <linux/kernel.h>
-#include <linux/perf_counter.h>
+#include <linux/perf_event.h>
 #include <linux/string.h>
 #include <asm/reg.h>
 #include <asm/cputable.h>
@@ -606,7 +606,8 @@ static struct power_pmu power4_pmu = {
 
 static int init_power4_pmu(void)
 {
-       if (strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power4"))
+       if (!cur_cpu_spec->oprofile_cpu_type ||
+           strcmp(cur_cpu_spec->oprofile_cpu_type, "ppc64/power4"))
                return -ENODEV;
 
        return register_power_pmu(&power4_pmu);