diff options
author | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-06-21 21:26:58 +0100 |
---|---|---|
committer | Jonathan Cameron <Jonathan.Cameron@huawei.com> | 2022-07-18 18:48:18 +0100 |
commit | bf19b23591afa929f51b861a6c470a9a436df620 (patch) | |
tree | 31351eed6ab876a2e1309ffd4888057c782bbb6c /drivers | |
parent | c9ccad99113d99a0c187f909caa326062db5de55 (diff) |
iio: dac: mcp4725: 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: Philippe Reynes <tremyfr@yahoo.fr>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20220621202719.13644-16-jic23@kernel.org
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/iio/dac/mcp4725.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c index 7fcb86288823..bb4b85a7b95b 100644 --- a/drivers/iio/dac/mcp4725.c +++ b/drivers/iio/dac/mcp4725.c @@ -42,7 +42,7 @@ struct mcp4725_data { struct regulator *vref_reg; }; -static int __maybe_unused mcp4725_suspend(struct device *dev) +static int mcp4725_suspend(struct device *dev) { struct mcp4725_data *data = iio_priv(i2c_get_clientdata( to_i2c_client(dev))); @@ -55,7 +55,7 @@ static int __maybe_unused mcp4725_suspend(struct device *dev) return i2c_master_send(data->client, outbuf, 2); } -static int __maybe_unused mcp4725_resume(struct device *dev) +static int mcp4725_resume(struct device *dev) { struct mcp4725_data *data = iio_priv(i2c_get_clientdata( to_i2c_client(dev))); @@ -68,7 +68,8 @@ static int __maybe_unused mcp4725_resume(struct device *dev) return i2c_master_send(data->client, outbuf, 2); } -static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, mcp4725_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, + mcp4725_resume); static ssize_t mcp4725_store_eeprom(struct device *dev, struct device_attribute *attr, const char *buf, size_t len) @@ -523,7 +524,7 @@ static struct i2c_driver mcp4725_driver = { .driver = { .name = MCP4725_DRV_NAME, .of_match_table = mcp4725_of_match, - .pm = &mcp4725_pm_ops, + .pm = pm_sleep_ptr(&mcp4725_pm_ops), }, .probe = mcp4725_probe, .remove = mcp4725_remove, |