Commit 1488ac99 authored by Zhang Rui's avatar Zhang Rui Committed by Rafael J. Wysocki

powercap: intel_rapl: Allow probing without CPUID match

Currently, CPU model checks is used to
1. get proper rapl_defaults callbacks for RAPL MSR/MMIO Interface.
2. create a platform device node for the intel_rapl_msr driver to probe.

Both of these are only mandatory for the RAPL MSR/MMIO Interface.

Make the CPUID match optional.
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
Tested-by: default avatarWang Wendy <wendy.wang@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 31cb1304
...@@ -1528,32 +1528,25 @@ static int __init rapl_init(void) ...@@ -1528,32 +1528,25 @@ static int __init rapl_init(void)
int ret; int ret;
id = x86_match_cpu(rapl_ids); id = x86_match_cpu(rapl_ids);
if (!id) { if (id) {
pr_err("driver does not support CPU family %d model %d\n",
boot_cpu_data.x86, boot_cpu_data.x86_model);
return -ENODEV;
}
rapl_defaults = (struct rapl_defaults *)id->driver_data; rapl_defaults = (struct rapl_defaults *)id->driver_data;
ret = register_pm_notifier(&rapl_pm_notifier);
if (ret)
return ret;
rapl_msr_platdev = platform_device_alloc("intel_rapl_msr", 0); rapl_msr_platdev = platform_device_alloc("intel_rapl_msr", 0);
if (!rapl_msr_platdev) { if (!rapl_msr_platdev)
ret = -ENOMEM; return -ENOMEM;
goto end;
}
ret = platform_device_add(rapl_msr_platdev); ret = platform_device_add(rapl_msr_platdev);
if (ret) if (ret) {
platform_device_put(rapl_msr_platdev); platform_device_put(rapl_msr_platdev);
return ret;
}
}
end: ret = register_pm_notifier(&rapl_pm_notifier);
if (ret) if (ret && rapl_msr_platdev) {
unregister_pm_notifier(&rapl_pm_notifier); platform_device_del(rapl_msr_platdev);
platform_device_put(rapl_msr_platdev);
}
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment