From: Triet Hoang <triet.hoang.dev@gmail.com>
To: basavaraj.natikar@amd.com
Cc: jikos@kernel.org, bentiss@kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Triet Hoang <triet.hoang.dev@gmail.com>
Subject: [PATCH] HID: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Date: Thu, 20 Aug 2026 16:09:21 +0700 [thread overview]
Message-ID: <20260820090921.2113684-1-triet.hoang.dev@gmail.com> (raw)
Convert the deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr().
This lets us drop the __maybe_unused annotations from the suspend and
resume callbacks, and reduces kernel size in case CONFIG_PM or
CONFIG_PM_SLEEP is disabled.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 8 ++++----
drivers/hid/hid-google-hammer.c | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index eda26a094d3f..731dfdd459ac 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -560,7 +560,7 @@ static void amd_sfh_shutdown(struct pci_dev *pdev)
}
}
-static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
+static int amd_mp2_pci_resume(struct device *dev)
{
struct amd_mp2_dev *mp2 = dev_get_drvdata(dev);
@@ -571,7 +571,7 @@ static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
return 0;
}
-static int __maybe_unused amd_mp2_pci_suspend(struct device *dev)
+static int amd_mp2_pci_suspend(struct device *dev)
{
struct amd_mp2_dev *mp2 = dev_get_drvdata(dev);
@@ -582,7 +582,7 @@ static int __maybe_unused amd_mp2_pci_suspend(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(amd_mp2_pm_ops, amd_mp2_pci_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(amd_mp2_pm_ops, amd_mp2_pci_suspend,
amd_mp2_pci_resume);
static const struct pci_device_id amd_mp2_pci_tbl[] = {
@@ -596,7 +596,7 @@ static struct pci_driver amd_mp2_pci_driver = {
.name = DRIVER_NAME,
.id_table = amd_mp2_pci_tbl,
.probe = amd_mp2_pci_probe,
- .driver.pm = &amd_mp2_pm_ops,
+ .driver.pm = pm_sleep_ptr(&amd_mp2_pm_ops),
.shutdown = amd_sfh_shutdown,
.remove = amd_sfh_remove,
.dev_groups = amd_sfh_groups,
diff --git a/drivers/hid/hid-google-hammer.c b/drivers/hid/hid-google-hammer.c
index c99c3c0d442e..d7a504e48775 100644
--- a/drivers/hid/hid-google-hammer.c
+++ b/drivers/hid/hid-google-hammer.c
@@ -132,7 +132,7 @@ static int cbas_ec_notify(struct notifier_block *nb,
return NOTIFY_OK;
}
-static __maybe_unused int cbas_ec_resume(struct device *dev)
+static int cbas_ec_resume(struct device *dev)
{
struct cros_ec_device *ec = dev_get_drvdata(dev->parent);
bool base_present;
@@ -163,7 +163,7 @@ static __maybe_unused int cbas_ec_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(cbas_ec_pm_ops, NULL, cbas_ec_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(cbas_ec_pm_ops, NULL, cbas_ec_resume);
static void cbas_ec_set_input(struct input_dev *input)
{
@@ -289,7 +289,7 @@ static struct platform_driver cbas_ec_driver = {
.name = "cbas_ec",
.acpi_match_table = ACPI_PTR(cbas_ec_acpi_ids),
.of_match_table = of_match_ptr(cbas_ec_of_match),
- .pm = &cbas_ec_pm_ops,
+ .pm = pm_sleep_ptr(&cbas_ec_pm_ops),
},
};
--
2.53.0
reply other threads:[~2026-08-20 9:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260820090921.2113684-1-triet.hoang.dev@gmail.com \
--to=triet.hoang.dev@gmail.com \
--cc=basavaraj.natikar@amd.com \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.