Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: axp20x-pek - switch to SYSTEM_SLEEP_PM_OPS() and pm_sleep_ptr()

SET_SYSTEM_SLEEP_PM_OPS() is deprecated as it requires explicit protection
against unused function warnings. The new combination of pm_sleep_ptr()
and SYSTEM_SLEEP_PM_OPS() allows the compiler to see the functions,
thus suppressing the warning, but still allowing the unused code to be
removed. Thus also drop the __maybe_unused markings. Here the
additional .resume_noirq callback is protected with pm_sleep_ptr(). This
isn't strictly necessary but is done for consistency with the other
callbacks.

Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20230114171620.42891-3-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jonathan Cameron and committed by
Dmitry Torokhov
e04a088b 28bbeca2

+5 -7
+5 -7
drivers/input/misc/axp20x-pek.c
··· 336 336 return 0; 337 337 } 338 338 339 - static int __maybe_unused axp20x_pek_suspend(struct device *dev) 339 + static int axp20x_pek_suspend(struct device *dev) 340 340 { 341 341 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); 342 342 ··· 355 355 return 0; 356 356 } 357 357 358 - static int __maybe_unused axp20x_pek_resume(struct device *dev) 358 + static int axp20x_pek_resume(struct device *dev) 359 359 { 360 360 struct axp20x_pek *axp20x_pek = dev_get_drvdata(dev); 361 361 ··· 389 389 } 390 390 391 391 static const struct dev_pm_ops axp20x_pek_pm_ops = { 392 - SET_SYSTEM_SLEEP_PM_OPS(axp20x_pek_suspend, axp20x_pek_resume) 393 - #ifdef CONFIG_PM_SLEEP 394 - .resume_noirq = axp20x_pek_resume_noirq, 395 - #endif 392 + SYSTEM_SLEEP_PM_OPS(axp20x_pek_suspend, axp20x_pek_resume) 393 + .resume_noirq = pm_sleep_ptr(axp20x_pek_resume_noirq), 396 394 }; 397 395 398 396 static const struct platform_device_id axp_pek_id_match[] = { ··· 411 413 .id_table = axp_pek_id_match, 412 414 .driver = { 413 415 .name = "axp20x-pek", 414 - .pm = &axp20x_pek_pm_ops, 416 + .pm = pm_sleep_ptr(&axp20x_pek_pm_ops), 415 417 .dev_groups = axp20x_groups, 416 418 }, 417 419 };