Commit 1a5bc41a authored by Marcus Folkesson's avatar Marcus Folkesson Committed by Jonathan Cameron

iio: dac: mcp4725: avoid using CONFIG_PM_SLEEP

This is already handled by SIMPLE_DEV_PM_OPS().
Signed-off-by: default avatarMarcus Folkesson <marcus.folkesson@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent b6ec220c
...@@ -45,7 +45,7 @@ struct mcp4725_data { ...@@ -45,7 +45,7 @@ struct mcp4725_data {
struct regulator *vref_reg; struct regulator *vref_reg;
}; };
static int mcp4725_suspend(struct device *dev) static int __maybe_unused mcp4725_suspend(struct device *dev)
{ {
struct mcp4725_data *data = iio_priv(i2c_get_clientdata( struct mcp4725_data *data = iio_priv(i2c_get_clientdata(
to_i2c_client(dev))); to_i2c_client(dev)));
...@@ -58,7 +58,7 @@ static int mcp4725_suspend(struct device *dev) ...@@ -58,7 +58,7 @@ static int mcp4725_suspend(struct device *dev)
return i2c_master_send(data->client, outbuf, 2); return i2c_master_send(data->client, outbuf, 2);
} }
static int mcp4725_resume(struct device *dev) static int __maybe_unused mcp4725_resume(struct device *dev)
{ {
struct mcp4725_data *data = iio_priv(i2c_get_clientdata( struct mcp4725_data *data = iio_priv(i2c_get_clientdata(
to_i2c_client(dev))); to_i2c_client(dev)));
...@@ -71,13 +71,7 @@ static int mcp4725_resume(struct device *dev) ...@@ -71,13 +71,7 @@ static int mcp4725_resume(struct device *dev)
return i2c_master_send(data->client, outbuf, 2); return i2c_master_send(data->client, outbuf, 2);
} }
#ifdef CONFIG_PM_SLEEP
static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, mcp4725_resume); static SIMPLE_DEV_PM_OPS(mcp4725_pm_ops, mcp4725_suspend, mcp4725_resume);
#define MCP4725_PM_OPS (&mcp4725_pm_ops)
#else
#define MCP4725_PM_OPS NULL
#endif
static ssize_t mcp4725_store_eeprom(struct device *dev, static ssize_t mcp4725_store_eeprom(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len) struct device_attribute *attr, const char *buf, size_t len)
...@@ -547,7 +541,7 @@ static struct i2c_driver mcp4725_driver = { ...@@ -547,7 +541,7 @@ static struct i2c_driver mcp4725_driver = {
.driver = { .driver = {
.name = MCP4725_DRV_NAME, .name = MCP4725_DRV_NAME,
.of_match_table = of_match_ptr(mcp4725_of_match), .of_match_table = of_match_ptr(mcp4725_of_match),
.pm = MCP4725_PM_OPS, .pm = &mcp4725_pm_ops,
}, },
.probe = mcp4725_probe, .probe = mcp4725_probe,
.remove = mcp4725_remove, .remove = mcp4725_remove,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment