mirror of https://github.com/torvalds/linux.git
ACPI: PM: sleep: Do not set suspend_ops unnecessarily
If none of the S1 - S3 sleep states is supported, it is not necessary to register suspend_ops, so don't do that then. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
parent
a9a8f827f9
commit
d69d1f7080
|
|
@ -815,14 +815,18 @@ void __weak acpi_s2idle_setup(void)
|
||||||
|
|
||||||
static void acpi_sleep_suspend_setup(void)
|
static void acpi_sleep_suspend_setup(void)
|
||||||
{
|
{
|
||||||
|
bool suspend_ops_needed = false;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = ACPI_STATE_S1; i < ACPI_STATE_S4; i++)
|
for (i = ACPI_STATE_S1; i < ACPI_STATE_S4; i++)
|
||||||
if (acpi_sleep_state_supported(i))
|
if (acpi_sleep_state_supported(i)) {
|
||||||
sleep_states[i] = 1;
|
sleep_states[i] = 1;
|
||||||
|
suspend_ops_needed = true;
|
||||||
|
}
|
||||||
|
|
||||||
suspend_set_ops(old_suspend_ordering ?
|
if (suspend_ops_needed)
|
||||||
&acpi_suspend_ops_old : &acpi_suspend_ops);
|
suspend_set_ops(old_suspend_ordering ?
|
||||||
|
&acpi_suspend_ops_old : &acpi_suspend_ops);
|
||||||
|
|
||||||
acpi_s2idle_setup();
|
acpi_s2idle_setup();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue