diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2023-01-14 20:16:09 +0300 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2023-01-28 01:49:52 +0300 |
commit | 452fcd2dcb1d74de99608930397857204f1335e6 (patch) | |
tree | d9f51808c119c78618f275023af815c484bcdfe1 /drivers/input/rmi4/rmi_spi.c | |
parent | e2eaf9e0e10c8ce2b2740a89d1fab0649345e353 (diff) | |
download | linux-452fcd2dcb1d74de99608930397857204f1335e6.tar.xz |
Input: rmi4 - switch to SYSTEM_SLEEP/RUNTIME_PM_OPS() and pm_ptr()
SET_SYSTEM_SLEEP_PM_OPS() and SET_RUNTIME_PM_OPS() are deprecated
as they requires explicit protection against unused function warnings.
The new combination of pm_ptr() and SYSTEM_SLEEP_PM_OPS() /
RUNTIME_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 #ifdef guards.
Whilst all 3 sets of callbacks are similar, there are small differences
that make it challenging to use a single pm_dev_ops structure - hence
leave the duplication as it stands.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Cc: Lyude Paul <lyude@redhat.com>
Cc: Andrew Duggan <aduggan@synaptics.com>
Link: https://lore.kernel.org/r/20230114171620.42891-6-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input/rmi4/rmi_spi.c')
-rw-r--r-- | drivers/input/rmi4/rmi_spi.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/input/rmi4/rmi_spi.c b/drivers/input/rmi4/rmi_spi.c index c82edda66b23..c5c5e7f3401e 100644 --- a/drivers/input/rmi4/rmi_spi.c +++ b/drivers/input/rmi4/rmi_spi.c @@ -447,7 +447,6 @@ static int rmi_spi_probe(struct spi_device *spi) return 0; } -#ifdef CONFIG_PM_SLEEP static int rmi_spi_suspend(struct device *dev) { struct spi_device *spi = to_spi_device(dev); @@ -473,9 +472,7 @@ static int rmi_spi_resume(struct device *dev) return ret; } -#endif -#ifdef CONFIG_PM static int rmi_spi_runtime_suspend(struct device *dev) { struct spi_device *spi = to_spi_device(dev); @@ -501,12 +498,10 @@ static int rmi_spi_runtime_resume(struct device *dev) return 0; } -#endif static const struct dev_pm_ops rmi_spi_pm = { - SET_SYSTEM_SLEEP_PM_OPS(rmi_spi_suspend, rmi_spi_resume) - SET_RUNTIME_PM_OPS(rmi_spi_runtime_suspend, rmi_spi_runtime_resume, - NULL) + SYSTEM_SLEEP_PM_OPS(rmi_spi_suspend, rmi_spi_resume) + RUNTIME_PM_OPS(rmi_spi_runtime_suspend, rmi_spi_runtime_resume, NULL) }; static const struct spi_device_id rmi_id[] = { @@ -518,7 +513,7 @@ MODULE_DEVICE_TABLE(spi, rmi_id); static struct spi_driver rmi_spi_driver = { .driver = { .name = "rmi4_spi", - .pm = &rmi_spi_pm, + .pm = pm_ptr(&rmi_spi_pm), .of_match_table = of_match_ptr(rmi_spi_of_match), }, .id_table = rmi_id, |