diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-06-21 21:26:45 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-07-18 18:48:17 +0100 |
commit | 078d37b73f0557ba7b4447037499eb2e03700aff (patch) | |
tree | 2a2a044a377ddace2f4aac8c917a6781af77ff31 /drivers/iio/adc/ad799x.c | |
parent | 93a73f6a2604e208b758b2bd8f622fb0b0c9098c (diff) |
iio: adc: ad799x: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
Using these newer macros allows the compiler to remove the unused
structure and functions when !CONFIG_PM_SLEEP + removes the need to
mark pm functions __maybe_unused.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220621202719.13644-3-jic23@kernel.org
Diffstat (limited to 'drivers/iio/adc/ad799x.c')
-rw-r--r-- | drivers/iio/adc/ad799x.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iio/adc/ad799x.c b/drivers/iio/adc/ad799x.c index 220228c375d3..262bd7665b33 100644 --- a/drivers/iio/adc/ad799x.c +++ b/drivers/iio/adc/ad799x.c @@ -896,7 +896,7 @@ static int ad799x_remove(struct i2c_client *client) return 0; } -static int __maybe_unused ad799x_suspend(struct device *dev) +static int ad799x_suspend(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); struct ad799x_state *st = iio_priv(indio_dev); @@ -908,7 +908,7 @@ static int __maybe_unused ad799x_suspend(struct device *dev) return 0; } -static int __maybe_unused ad799x_resume(struct device *dev) +static int ad799x_resume(struct device *dev) { struct iio_dev *indio_dev = i2c_get_clientdata(to_i2c_client(dev)); struct ad799x_state *st = iio_priv(indio_dev); @@ -941,7 +941,7 @@ static int __maybe_unused ad799x_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(ad799x_pm_ops, ad799x_suspend, ad799x_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(ad799x_pm_ops, ad799x_suspend, ad799x_resume); static const struct i2c_device_id ad799x_id[] = { { "ad7991", ad7991 }, @@ -960,7 +960,7 @@ MODULE_DEVICE_TABLE(i2c, ad799x_id); static struct i2c_driver ad799x_driver = { .driver = { .name = "ad799x", - .pm = &ad799x_pm_ops, + .pm = pm_sleep_ptr(&ad799x_pm_ops), }, .probe = ad799x_probe, .remove = ad799x_remove, |