From: Mario Limonciello <mario.limonciello@amd.com>
To: "Rafael J . Wysocki" <rjw@rjwysocki.net>, <linux-acpi@vger.kernel.org>
Cc: <Shyam-sundar.S-k@amd.com>,
Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
Mario Limonciello <mario.limonciello@amd.com>
Subject: [PATCH 1/3] PM: suspend: Move some structure declarations around
Date: Wed, 5 Jan 2022 13:39:08 -0600 [thread overview]
Message-ID: <20220105193910.25678-2-mario.limonciello@amd.com> (raw)
In-Reply-To: <20220105193910.25678-1-mario.limonciello@amd.com>
Future patches will modify members of these structures dependent
upon these locations. Move the structure declarations first to
make those patches easier to consume.
Reviewed-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
drivers/acpi/x86/s2idle.c | 20 ++++++++++----------
kernel/power/suspend.c | 14 +++++++-------
2 files changed, 17 insertions(+), 17 deletions(-)
diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index 1c48358b43ba..32ab4ba5adb9 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -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);
diff --git a/kernel/power/suspend.c b/kernel/power/suspend.c
index 80cc1f0f502b..597c5e65aa45 100644
--- a/kernel/power/suspend.c
+++ b/kernel/power/suspend.c
@@ -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. */
--
2.25.1
next prev parent reply other threads:[~2022-01-05 19:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-05 19:39 [PATCH 0/3] On AMD platforms only offer s2idle w/ proper FW Mario Limonciello
2022-01-05 19:39 ` Mario Limonciello [this message]
2022-01-05 19:39 ` [PATCH 2/3] PM: sleep: Don't always assume s2idle will be enabled Mario Limonciello
2022-01-05 19:39 ` [PATCH 3/3] acpi: sleep: Don't offer s2idle on AMD platforms without LPS0 Mario Limonciello
2022-01-11 15:52 ` [PATCH 0/3] On AMD platforms only offer s2idle w/ proper FW Rafael J. Wysocki
2022-01-11 16:23 ` Limonciello, Mario
2022-01-11 17:05 ` Rafael J. Wysocki
2022-01-11 17:32 ` Limonciello, Mario
2022-01-11 17:32 ` Deucher, Alexander
2022-01-11 17:44 ` Rafael J. Wysocki
2022-01-11 18:30 ` Deucher, Alexander
2022-01-11 18:36 ` Limonciello, Mario
2022-01-11 19:20 ` Rafael J. Wysocki
2022-01-11 19:35 ` Limonciello, Mario
2022-01-11 19:48 ` Rafael J. Wysocki
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220105193910.25678-2-mario.limonciello@amd.com \
--to=mario.limonciello@amd.com \
--cc=Basavaraj.Natikar@amd.com \
--cc=Shyam-sundar.S-k@amd.com \
--cc=linux-acpi@vger.kernel.org \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).