Thread (4 messages) flat view 4 messages, 2 authors, 2026-08-21

Re: [PATCH] input: touchscreen: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

From: sashiko-bot@kernel.org
Date: 2026-08-21 02:55:14

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The patch introduces a strict C compiler redefinition error for `ad7879_pm_ops` when `CONFIG_PM_SLEEP` is enabled.
--
--- Patch [1]: [PATCH] input: touchscreen: Convert to DEFINE_SIMPLE_DEV_PM_OPS() ---
commit 44d9a5ca9f2aa03594a9658d8105747b57b227ba
Author: Triet Hoang [off-list ref]

input: touchscreen: Convert to DEFINE_SIMPLE_DEV_PM_OPS()

This commit updates several touchscreen drivers to use the newer
DEFINE_SIMPLE_DEV_PM_OPS and pm_sleep_ptr() macros instead of the deprecated
SIMPLE_DEV_PM_OPS. This allows the removal of __maybe_unused annotations on
suspend and resume callbacks.
quoted hunk ↗ jump to hunk
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
index 31d2a3029d5f6..f686f028d4bc9 100644
--- a/drivers/input/touchscreen/ad7879.c
+++ b/drivers/input/touchscreen/ad7879.c
[ ... ]
quoted hunk ↗ jump to hunk
@@ -329,8 +329,8 @@ static int __maybe_unused ad7879_resume(struct device *dev)
 	return 0;
 }
 
-SIMPLE_DEV_PM_OPS(ad7879_pm_ops, ad7879_suspend, ad7879_resume);
-EXPORT_SYMBOL(ad7879_pm_ops);
+DEFINE_SIMPLE_DEV_PM_OPS(ad7879_pm_ops, ad7879_suspend, ad7879_resume);
+EXPORT_SIMPLE_DEV_PM_OPS(ad7879_pm_ops, ad7879_suspend, ad7879_resume);
[Severity: Low]
Does this cause a compilation error when CONFIG_PM_SLEEP is enabled?

Both DEFINE_SIMPLE_DEV_PM_OPS and EXPORT_SIMPLE_DEV_PM_OPS expand to a
complete initialization of the ad7879_pm_ops struct. Using both sequentially
redefines the same global variable, which will result in a build failure.

Should this just be EXPORT_SIMPLE_DEV_PM_OPS by itself?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260821024450.57369-1-triet.hoang.dev@gmail.com?part=1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help