aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/iio/dac
diff options
context:
space:
mode:
authorJonathan Cameron <Jonathan.Cameron@huawei.com>2022-06-21 21:26:56 +0100
committerJonathan Cameron <Jonathan.Cameron@huawei.com>2022-07-18 18:48:18 +0100
commit7b9d3e85d71f3fdf601a802886465358b3793bae (patch)
tree51989264df124aa11f9d20e0022403cc6c3d2d66 /drivers/iio/dac
parentiio: dac: ltc1660: Switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr() (diff)
downloadwireguard-linux-7b9d3e85d71f3fdf601a802886465358b3793bae.tar.xz
wireguard-linux-7b9d3e85d71f3fdf601a802886465358b3793bae.zip
iio: dac: max517: 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: Marcus Folkesson <marcus.folkesson@gmail.com> Reviewed-by: Paul Cercueil <paul@crapouillou.net> Link: https://lore.kernel.org/r/20220621202719.13644-14-jic23@kernel.org
Diffstat (limited to 'drivers/iio/dac')
-rw-r--r--drivers/iio/dac/max517.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/iio/dac/max517.c b/drivers/iio/dac/max517.c
index a6ef555153f4..373ce6ff83b7 100644
--- a/drivers/iio/dac/max517.c
+++ b/drivers/iio/dac/max517.c
@@ -100,21 +100,21 @@ static int max517_write_raw(struct iio_dev *indio_dev,
return ret;
}
-static int __maybe_unused max517_suspend(struct device *dev)
+static int max517_suspend(struct device *dev)
{
u8 outbuf = COMMAND_PD;
return i2c_master_send(to_i2c_client(dev), &outbuf, 1);
}
-static int __maybe_unused max517_resume(struct device *dev)
+static int max517_resume(struct device *dev)
{
u8 outbuf = 0;
return i2c_master_send(to_i2c_client(dev), &outbuf, 1);
}
-static SIMPLE_DEV_PM_OPS(max517_pm_ops, max517_suspend, max517_resume);
+static DEFINE_SIMPLE_DEV_PM_OPS(max517_pm_ops, max517_suspend, max517_resume);
static const struct iio_info max517_info = {
.read_raw = max517_read_raw,
@@ -201,7 +201,7 @@ MODULE_DEVICE_TABLE(i2c, max517_id);
static struct i2c_driver max517_driver = {
.driver = {
.name = MAX517_DRV_NAME,
- .pm = &max517_pm_ops,
+ .pm = pm_sleep_ptr(&max517_pm_ops),
},
.probe = max517_probe,
.id_table = max517_id,