x86: intel_epb: Take CONFIG_PM into account
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 9 May 2019 21:28:41 +0000 (23:28 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 10 May 2019 08:47:35 +0000 (10:47 +0200)
commit9ed0985332a6576efbc3e435459a857e50e0d72c
tree7ce977c8cd154a648b135c6ca01c5253eb14ce71
parent8f5e823f9131a430b12f73e9436d7486e20c16f5
x86: intel_epb: Take CONFIG_PM into account

Commit b9c273babce7 ("PM / arch: x86: MSR_IA32_ENERGY_PERF_BIAS sysfs
interface") caused kernels built with CONFIG_PM unset to crash on
systems supporting the Performance and Energy Bias Hint (EPB),
because it attempts to add files to sysfs directories that don't
exist on those systems.

Prevent that from happening by taking CONFIG_PM into account so
that the code depending on it is not compiled at all when it is
not set.

Fixes: b9c273babce7 ("PM / arch: x86: MSR_IA32_ENERGY_PERF_BIAS sysfs interface")
Reported-by: Ido Schimmel <idosch@mellanox.com>
Tested-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/intel_epb.c