diff options
author | Jonathan Cameron | 2022-06-21 21:27:11 +0100 |
---|---|---|
committer | Jonathan Cameron | 2022-07-18 18:48:19 +0100 |
commit | 7b79cda9e297023ad605efaf9a0ae0cf7e27e70d (patch) | |
tree | ded45cf870cf7eb2cc58fa4f027c32f58022665b /drivers/iio | |
parent | 2583f5e828155c2dcacda64c1f42e86d8a4c2d5b (diff) |
iio: light: gp2ap002: Switch to DEFINE_RUNTIME_DEV_PM_OPS and pm_ptr()
Switching to these newer macros allows use of pm_ptr() to remove
the unused functions and structure if !CONFIG_PM without the need to
mark anything __maybe_unused.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220621202719.13644-29-jic23@kernel.org
Diffstat (limited to 'drivers/iio')
-rw-r--r-- | drivers/iio/light/gp2ap002.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/iio/light/gp2ap002.c b/drivers/iio/light/gp2ap002.c index c6d1d88d3775..e2707416f9a8 100644 --- a/drivers/iio/light/gp2ap002.c +++ b/drivers/iio/light/gp2ap002.c @@ -635,7 +635,7 @@ static int gp2ap002_remove(struct i2c_client *client) return 0; } -static int __maybe_unused gp2ap002_runtime_suspend(struct device *dev) +static int gp2ap002_runtime_suspend(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct gp2ap002 *gp2ap002 = iio_priv(indio_dev); @@ -660,7 +660,7 @@ static int __maybe_unused gp2ap002_runtime_suspend(struct device *dev) return 0; } -static int __maybe_unused gp2ap002_runtime_resume(struct device *dev) +static int gp2ap002_runtime_resume(struct device *dev) { struct iio_dev *indio_dev = dev_get_drvdata(dev); struct gp2ap002 *gp2ap002 = iio_priv(indio_dev); @@ -691,12 +691,8 @@ static int __maybe_unused gp2ap002_runtime_resume(struct device *dev) return 0; } -static const struct dev_pm_ops gp2ap002_dev_pm_ops = { - SET_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, - pm_runtime_force_resume) - SET_RUNTIME_PM_OPS(gp2ap002_runtime_suspend, - gp2ap002_runtime_resume, NULL) -}; +static DEFINE_RUNTIME_DEV_PM_OPS(gp2ap002_dev_pm_ops, gp2ap002_runtime_suspend, + gp2ap002_runtime_resume, NULL); static const struct i2c_device_id gp2ap002_id_table[] = { { "gp2ap002", 0 }, @@ -715,7 +711,7 @@ static struct i2c_driver gp2ap002_driver = { .driver = { .name = "gp2ap002", .of_match_table = gp2ap002_of_match, - .pm = &gp2ap002_dev_pm_ops, + .pm = pm_ptr(&gp2ap002_dev_pm_ops), }, .probe = gp2ap002_probe, .remove = gp2ap002_remove, |