@@ -361,6 +361,16 @@ static int validate_dsm(acpi_handle handle, const char *uuid, int rev, guid_t *d
return ret;
}
+static const struct platform_s2idle_ops acpi_s2idle_ops_lps0 = {
+ .begin = acpi_s2idle_begin,
+ .prepare = acpi_s2idle_prepare,
+ .prepare_late = acpi_s2idle_prepare_late,
+ .wake = acpi_s2idle_wake,
+ .restore_early = acpi_s2idle_restore_early,
+ .restore = acpi_s2idle_restore,
+ .end = acpi_s2idle_end,
+};
+
static int lps0_device_attach(struct acpi_device *adev,
const struct acpi_device_id *not_used)
{
@@ -508,16 +518,6 @@ void acpi_s2idle_restore_early(void)
lps0_dsm_func_mask, lps0_dsm_guid);
}
-static const struct platform_s2idle_ops acpi_s2idle_ops_lps0 = {
- .begin = acpi_s2idle_begin,
- .prepare = acpi_s2idle_prepare,
- .prepare_late = acpi_s2idle_prepare_late,
- .wake = acpi_s2idle_wake,
- .restore_early = acpi_s2idle_restore_early,
- .restore = acpi_s2idle_restore,
- .end = acpi_s2idle_end,
-};
-
void acpi_s2idle_setup(void)
{
acpi_scan_add_handler(&lps0_handler);
@@ -73,13 +73,6 @@ bool pm_suspend_default_s2idle(void)
}
EXPORT_SYMBOL_GPL(pm_suspend_default_s2idle);
-void s2idle_set_ops(const struct platform_s2idle_ops *ops)
-{
- lock_system_sleep();
- s2idle_ops = ops;
- unlock_system_sleep();
-}
-
static void s2idle_begin(void)
{
s2idle_state = S2IDLE_STATE_NONE;
@@ -169,6 +162,13 @@ static bool valid_state(suspend_state_t state)
suspend_ops->enter;
}
+void s2idle_set_ops(const struct platform_s2idle_ops *ops)
+{
+ lock_system_sleep();
+ s2idle_ops = ops;
+ unlock_system_sleep();
+}
+
void __init pm_states_init(void)
{
/* "mem" and "freeze" are always present in /sys/power/state. */