From: Triet Hoang <triet.hoang.dev@gmail.com>
To: sashiko-bot@kernel.org
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
sashiko-reviews@lists.linux.dev, triet.hoang.dev@gmail.com
Subject: [PATCH v2] input: misc: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Date: Fri, 21 Aug 2026 11:15:46 +0700 [thread overview]
Message-ID: <20260821041546.110119-1-triet.hoang.dev@gmail.com> (raw)
In-Reply-To: <20260821025021.9F9891F000E9@smtp.kernel.org>
Convert deprecated SIMPLE_DEV_PM_OPS
to DEFINE_SIMPLE_DEV_PM_OPS and pm_ptr/pm_sleep_ptr().
This lets us drop the __maybe_unused annotations
from the resume callbacks and reduces kernel size
when CONFIG_PM or CONFIG_PM_SLEEP is disabled.
Signed-off-by: Triet Hoang <triet.hoang.dev@gmail.com>
---
Changes in v2:
- Use pm_ptr() for pm80x_onkey_pm_ops
- Remove #ifdef CONFIG_PM
---
drivers/input/misc/88pm80x_onkey.c | 4 ++--
drivers/input/misc/nxp-bbnsm-pwrkey.c | 8 ++++----
include/linux/mfd/88pm80x.h | 2 --
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/input/misc/88pm80x_onkey.c b/drivers/input/misc/88pm80x_onkey.c
index fee28e537898..3d8fe0b4ed50 100644
--- a/drivers/input/misc/88pm80x_onkey.c
+++ b/drivers/input/misc/88pm80x_onkey.c
@@ -47,7 +47,7 @@ static irqreturn_t pm80x_onkey_handler(int irq, void *data)
return IRQ_HANDLED;
}
-static SIMPLE_DEV_PM_OPS(pm80x_onkey_pm_ops, pm80x_dev_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(pm80x_onkey_pm_ops, pm80x_dev_suspend,
pm80x_dev_resume);
static int pm80x_onkey_probe(struct platform_device *pdev)
@@ -138,7 +138,7 @@ static void pm80x_onkey_remove(struct platform_device *pdev)
static struct platform_driver pm80x_onkey_driver = {
.driver = {
.name = "88pm80x-onkey",
- .pm = &pm80x_onkey_pm_ops,
+ .pm = pm_ptr(&pm80x_onkey_pm_ops),
},
.probe = pm80x_onkey_probe,
.remove = pm80x_onkey_remove,
diff --git a/drivers/input/misc/nxp-bbnsm-pwrkey.c b/drivers/input/misc/nxp-bbnsm-pwrkey.c
index 0c7b8f8ef4a5..6af6e0f6395f 100644
--- a/drivers/input/misc/nxp-bbnsm-pwrkey.c
+++ b/drivers/input/misc/nxp-bbnsm-pwrkey.c
@@ -193,7 +193,7 @@ static void bbnsm_pwrkey_remove(struct platform_device *pdev)
device_init_wakeup(&pdev->dev, false);
}
-static int __maybe_unused bbnsm_pwrkey_suspend(struct device *dev)
+static int bbnsm_pwrkey_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct bbnsm_pwrkey *bbnsm = platform_get_drvdata(pdev);
@@ -203,7 +203,7 @@ static int __maybe_unused bbnsm_pwrkey_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused bbnsm_pwrkey_resume(struct device *dev)
+static int bbnsm_pwrkey_resume(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
struct bbnsm_pwrkey *bbnsm = platform_get_drvdata(pdev);
@@ -213,7 +213,7 @@ static int __maybe_unused bbnsm_pwrkey_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(bbnsm_pwrkey_pm_ops, bbnsm_pwrkey_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(bbnsm_pwrkey_pm_ops, bbnsm_pwrkey_suspend,
bbnsm_pwrkey_resume);
static const struct of_device_id bbnsm_pwrkey_ids[] = {
@@ -225,7 +225,7 @@ MODULE_DEVICE_TABLE(of, bbnsm_pwrkey_ids);
static struct platform_driver bbnsm_pwrkey_driver = {
.driver = {
.name = "bbnsm_pwrkey",
- .pm = &bbnsm_pwrkey_pm_ops,
+ .pm = pm_sleep_ptr(&bbnsm_pwrkey_pm_ops),
.of_match_table = bbnsm_pwrkey_ids,
},
.probe = bbnsm_pwrkey_probe,
diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h
index 551ef1c367d6..be1b0d961e01 100644
--- a/include/linux/mfd/88pm80x.h
+++ b/include/linux/mfd/88pm80x.h
@@ -339,7 +339,6 @@ static inline void pm80x_free_irq(struct pm80x_chip *pm80x, int irq, void *data)
free_irq(regmap_irq_get_virq(pm80x->irq_data, irq), data);
}
-#ifdef CONFIG_PM
static inline int pm80x_dev_suspend(struct device *dev)
{
struct platform_device *pdev = to_platform_device(dev);
@@ -363,7 +362,6 @@ static inline int pm80x_dev_resume(struct device *dev)
return 0;
}
-#endif
extern int pm80x_init(struct i2c_client *client);
extern int pm80x_deinit(void);
--
2.53.0
next prev parent reply other threads:[~2026-08-21 4:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-21 2:42 [PATCH] input: misc: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
2026-08-21 2:50 ` sashiko-bot
2026-08-21 4:15 ` Triet Hoang [this message]
2026-08-21 4:25 ` [PATCH v2] " sashiko-bot
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=20260821041546.110119-1-triet.hoang.dev@gmail.com \
--to=triet.hoang.dev@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=sashiko-bot@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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.