Commit 47e79d3
Input: wistron_btns - use pm_sleep_ptr() to allow removal of ifdef CONFIG_PM guards
As the guards only apply to suspend and resume, #ifdef CONFIG_PM_SLEEP
would have been a tighter protection. As pm_sleep_ptr() lets the compiler
see the protected ops structure and callbacks but also lets the compiler
remove it as unused code if !CONFIG_PM_SLEEP this allows the #ifdef
guards to be removed, slightly simplifying the resulting code.
--
It seems likely that DEFINE_SIMPLE_DEV_PM_OPS() would work here but
I'd prefer not to make that change unless someone can confirm that the
extra callbacks registered will have no unwanted side effects in this
driver.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20230114171620.42891-17-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>1 parent f33f61a commit 47e79d3
1 file changed
Lines changed: 1 addition & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1295 | 1295 | | |
1296 | 1296 | | |
1297 | 1297 | | |
1298 | | - | |
1299 | 1298 | | |
1300 | 1299 | | |
1301 | 1300 | | |
| |||
1330 | 1329 | | |
1331 | 1330 | | |
1332 | 1331 | | |
1333 | | - | |
1334 | 1332 | | |
1335 | 1333 | | |
1336 | 1334 | | |
1337 | 1335 | | |
1338 | | - | |
1339 | | - | |
1340 | | - | |
| 1336 | + | |
1341 | 1337 | | |
1342 | 1338 | | |
1343 | 1339 | | |
| |||
0 commit comments