Merge tag 'cleanup-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/arm...
[cascardo/linux.git] / arch / arm / mach-omap2 / pmu.c
index 9ace8ea..a69e9a3 100644 (file)
@@ -13,7 +13,7 @@
  */
 #include <linux/of.h>
 
-#include <asm/pmu.h>
+#include <asm/system_info.h>
 
 #include "soc.h"
 #include "omap_hwmod.h"
@@ -37,7 +37,8 @@ static int __init omap2_init_pmu(unsigned oh_num, char *oh_names[])
 {
        int i;
        struct omap_hwmod *oh[3];
-       char *dev_name = "arm-pmu";
+       char *dev_name = cpu_architecture() == CPU_ARCH_ARMv6 ?
+                        "armv6-pmu" : "armv7-pmu";
 
        if ((!oh_num) || (oh_num > 3))
                return -EINVAL;
@@ -54,10 +55,7 @@ static int __init omap2_init_pmu(unsigned oh_num, char *oh_names[])
        WARN(IS_ERR(omap_pmu_dev), "Can't build omap_device for %s.\n",
             dev_name);
 
-       if (IS_ERR(omap_pmu_dev))
-               return PTR_ERR(omap_pmu_dev);
-
-       return 0;
+       return PTR_RET(omap_pmu_dev);
 }
 
 static int __init omap_init_pmu(void)