* [PATCH] extcon: axp288: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
@ 2026-08-20 8:22 Triet Hoang
2026-08-20 8:27 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Triet Hoang @ 2026-08-20 8:22 UTC (permalink / raw)
To: linux-kernel; +Cc: myungjoo.ham, cw00.choi, wens, hansg, Triet Hoang
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/extcon/extcon-axp288.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
index 19856dddade6..f073aa3b52cb 100644
--- a/drivers/extcon/extcon-axp288.c
+++ b/drivers/extcon/extcon-axp288.c
@@ -476,7 +476,7 @@ static int axp288_extcon_probe(struct platform_device *pdev)
return 0;
}
-static int __maybe_unused axp288_extcon_suspend(struct device *dev)
+static int axp288_extcon_suspend(struct device *dev)
{
struct axp288_extcon_info *info = dev_get_drvdata(dev);
@@ -486,7 +486,7 @@ static int __maybe_unused axp288_extcon_suspend(struct device *dev)
return 0;
}
-static int __maybe_unused axp288_extcon_resume(struct device *dev)
+static int axp288_extcon_resume(struct device *dev)
{
struct axp288_extcon_info *info = dev_get_drvdata(dev);
@@ -501,7 +501,7 @@ static int __maybe_unused axp288_extcon_resume(struct device *dev)
return 0;
}
-static SIMPLE_DEV_PM_OPS(axp288_extcon_pm_ops, axp288_extcon_suspend,
+static DEFINE_SIMPLE_DEV_PM_OPS(axp288_extcon_pm_ops, axp288_extcon_suspend,
axp288_extcon_resume);
static const struct platform_device_id axp288_extcon_table[] = {
@@ -515,7 +515,7 @@ static struct platform_driver axp288_extcon_driver = {
.id_table = axp288_extcon_table,
.driver = {
.name = "axp288_extcon",
- .pm = &axp288_extcon_pm_ops,
+ .pm = pm_sleep_ptr(&axp288_extcon_pm_ops),
},
};
module_platform_driver(axp288_extcon_driver);
--
2.53.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] extcon: axp288: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
2026-08-20 8:22 [PATCH] extcon: axp288: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
@ 2026-08-20 8:27 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2026-08-20 8:27 UTC (permalink / raw)
To: Triet Hoang, linux-kernel; +Cc: myungjoo.ham, cw00.choi, wens
Hi,
On 20-Aug-26 10:22, Triet Hoang wrote:
> 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>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
Regards,
Hans
> ---
> drivers/extcon/extcon-axp288.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/extcon/extcon-axp288.c b/drivers/extcon/extcon-axp288.c
> index 19856dddade6..f073aa3b52cb 100644
> --- a/drivers/extcon/extcon-axp288.c
> +++ b/drivers/extcon/extcon-axp288.c
> @@ -476,7 +476,7 @@ static int axp288_extcon_probe(struct platform_device *pdev)
> return 0;
> }
>
> -static int __maybe_unused axp288_extcon_suspend(struct device *dev)
> +static int axp288_extcon_suspend(struct device *dev)
> {
> struct axp288_extcon_info *info = dev_get_drvdata(dev);
>
> @@ -486,7 +486,7 @@ static int __maybe_unused axp288_extcon_suspend(struct device *dev)
> return 0;
> }
>
> -static int __maybe_unused axp288_extcon_resume(struct device *dev)
> +static int axp288_extcon_resume(struct device *dev)
> {
> struct axp288_extcon_info *info = dev_get_drvdata(dev);
>
> @@ -501,7 +501,7 @@ static int __maybe_unused axp288_extcon_resume(struct device *dev)
> return 0;
> }
>
> -static SIMPLE_DEV_PM_OPS(axp288_extcon_pm_ops, axp288_extcon_suspend,
> +static DEFINE_SIMPLE_DEV_PM_OPS(axp288_extcon_pm_ops, axp288_extcon_suspend,
> axp288_extcon_resume);
>
> static const struct platform_device_id axp288_extcon_table[] = {
> @@ -515,7 +515,7 @@ static struct platform_driver axp288_extcon_driver = {
> .id_table = axp288_extcon_table,
> .driver = {
> .name = "axp288_extcon",
> - .pm = &axp288_extcon_pm_ops,
> + .pm = pm_sleep_ptr(&axp288_extcon_pm_ops),
> },
> };
> module_platform_driver(axp288_extcon_driver);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-20 8:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-20 8:22 [PATCH] extcon: axp288: Convert to DEFINE_SIMPLE_DEV_PM_OPS() Triet Hoang
2026-08-20 8:27 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox