--- zzzz-none-000/linux-3.10.107/arch/arm/mach-omap2/pmu.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/arch/arm/mach-omap2/pmu.c 2021-02-04 17:41:59.000000000 +0000 @@ -13,7 +13,7 @@ */ #include -#include +#include #include "soc.h" #include "omap_hwmod.h" @@ -37,7 +37,8 @@ { 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 @@ 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_ERR_OR_ZERO(omap_pmu_dev); } static int __init omap_init_pmu(void)