Skip to content

Commit 6b9c160

Browse files
jic23dtor
authored andcommitted
Input: applespi - use pm_sleep_ptr() and SYSTEM_SLEEP_PM_OPS()
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. In this case we also have a .poweroff_late() callback. Whilst not strictly necessary, to future proof against relaxation of the protection of the main driver.pm = pm_sleep_ptr() protect this pointer with pm_sleep_ptr() as would be done if the LATE_SYSTEM_SLEEP_PM_OPS() macro were used to set it. Signed-off-by: Jonathan Cameron <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent c3c2f2b commit 6b9c160

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/input/keyboard/applespi.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1876,7 +1876,7 @@ static int applespi_poweroff_late(struct device *dev)
18761876
return 0;
18771877
}
18781878

1879-
static int __maybe_unused applespi_suspend(struct device *dev)
1879+
static int applespi_suspend(struct device *dev)
18801880
{
18811881
struct spi_device *spi = to_spi_device(dev);
18821882
struct applespi_data *applespi = spi_get_drvdata(spi);
@@ -1903,7 +1903,7 @@ static int __maybe_unused applespi_suspend(struct device *dev)
19031903
return 0;
19041904
}
19051905

1906-
static int __maybe_unused applespi_resume(struct device *dev)
1906+
static int applespi_resume(struct device *dev)
19071907
{
19081908
struct spi_device *spi = to_spi_device(dev);
19091909
struct applespi_data *applespi = spi_get_drvdata(spi);
@@ -1947,15 +1947,15 @@ static const struct acpi_device_id applespi_acpi_match[] = {
19471947
MODULE_DEVICE_TABLE(acpi, applespi_acpi_match);
19481948

19491949
static const struct dev_pm_ops applespi_pm_ops = {
1950-
SET_SYSTEM_SLEEP_PM_OPS(applespi_suspend, applespi_resume)
1951-
.poweroff_late = applespi_poweroff_late,
1950+
SYSTEM_SLEEP_PM_OPS(applespi_suspend, applespi_resume)
1951+
.poweroff_late = pm_sleep_ptr(applespi_poweroff_late),
19521952
};
19531953

19541954
static struct spi_driver applespi_driver = {
19551955
.driver = {
19561956
.name = "applespi",
19571957
.acpi_match_table = applespi_acpi_match,
1958-
.pm = &applespi_pm_ops,
1958+
.pm = pm_sleep_ptr(&applespi_pm_ops),
19591959
},
19601960
.probe = applespi_probe,
19611961
.remove = applespi_remove,

0 commit comments

Comments
 (0)