powercap: DTPM: Check for Energy Model type
[platform/kernel/linux-starfive.git] / drivers / powercap / dtpm_cpu.c
index bca2f91..f5eced0 100644 (file)
@@ -211,7 +211,7 @@ static int __dtpm_cpu_setup(int cpu, struct dtpm *parent)
                return 0;
 
        pd = em_cpu_get(cpu);
-       if (!pd)
+       if (!pd || em_is_artificial(pd))
                return -EINVAL;
 
        dtpm_cpu = kzalloc(sizeof(*dtpm_cpu), GFP_KERNEL);