* [PATCH] iio: dac: max517: avoid using CONFIG_PM_SLEEP
@ 2018-08-10 18:51 Marcus Folkesson
2018-08-10 18:51 ` [PATCH] iio: dac: max5821: " Marcus Folkesson
2018-08-10 18:51 ` [PATCH] iio: dac: mcp4725: " Marcus Folkesson
0 siblings, 2 replies; 3+ messages in thread
From: Marcus Folkesson @ 2018-08-10 18:51 UTC (permalink / raw)
To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Marcus Folkesson
Cc: linux-iio, linux-kernel
SIMPLE_DEV_PM_OPS() is already doing this.
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
drivers/iio/dac/max517.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/dac/max517.c b/drivers/iio/dac/max517.c
index 1d853247a205..451d10e323cf 100644
--- a/drivers/iio/dac/max517.c
+++ b/drivers/iio/dac/max517.c
@@ -113,15 +113,14 @@ static int max517_write_raw(struct iio_dev *indio_dev,
return ret;
}
-#ifdef CONFIG_PM_SLEEP
-static int max517_suspend(struct device *dev)
+static int __maybe_unused max517_suspend(struct device *dev)
{
u8 outbuf = COMMAND_PD;
return i2c_master_send(to_i2c_client(dev), &outbuf, 1);
}
-static int max517_resume(struct device *dev)
+static int __maybe_unused max517_resume(struct device *dev)
{
u8 outbuf = 0;
@@ -129,10 +128,6 @@ static int max517_resume(struct device *dev)
}
static SIMPLE_DEV_PM_OPS(max517_pm_ops, max517_suspend, max517_resume);
-#define MAX517_PM_OPS (&max517_pm_ops)
-#else
-#define MAX517_PM_OPS NULL
-#endif
static const struct iio_info max517_info = {
.read_raw = max517_read_raw,
@@ -229,7 +224,7 @@ MODULE_DEVICE_TABLE(i2c, max517_id);
static struct i2c_driver max517_driver = {
.driver = {
.name = MAX517_DRV_NAME,
- .pm = MAX517_PM_OPS,
+ .pm = &max517_pm_ops,
},
.probe = max517_probe,
.remove = max517_remove,
--
2.11.0.rc2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] iio: dac: max5821: avoid using CONFIG_PM_SLEEP
2018-08-10 18:51 [PATCH] iio: dac: max517: avoid using CONFIG_PM_SLEEP Marcus Folkesson
@ 2018-08-10 18:51 ` Marcus Folkesson
2018-08-10 18:51 ` [PATCH] iio: dac: mcp4725: " Marcus Folkesson
1 sibling, 0 replies; 3+ messages in thread
From: Marcus Folkesson @ 2018-08-10 18:51 UTC (permalink / raw)
To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Marcus Folkesson
Cc: linux-iio, linux-kernel
SIMPLE_DEV_PM_OPS() is already doing this.
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
drivers/iio/dac/max5821.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/iio/dac/max5821.c b/drivers/iio/dac/max5821.c
index d0ecc1fdd8fc..f0cf6903dcd2 100644
--- a/drivers/iio/dac/max5821.c
+++ b/drivers/iio/dac/max5821.c
@@ -270,8 +270,7 @@ static int max5821_write_raw(struct iio_dev *indio_dev,
}
}
-#ifdef CONFIG_PM_SLEEP
-static int max5821_suspend(struct device *dev)
+static int __maybe_unused max5821_suspend(struct device *dev)
{
u8 outbuf[2] = { MAX5821_EXTENDED_COMMAND_MODE,
MAX5821_EXTENDED_DAC_A |
@@ -281,7 +280,7 @@ static int max5821_suspend(struct device *dev)
return i2c_master_send(to_i2c_client(dev), outbuf, 2);
}
-static int max5821_resume(struct device *dev)
+static int __maybe_unused max5821_resume(struct device *dev)
{
u8 outbuf[2] = { MAX5821_EXTENDED_COMMAND_MODE,
MAX5821_EXTENDED_DAC_A |
@@ -292,10 +291,6 @@ static int max5821_resume(struct device *dev)
}
static SIMPLE_DEV_PM_OPS(max5821_pm_ops, max5821_suspend, max5821_resume);
-#define MAX5821_PM_OPS (&max5821_pm_ops)
-#else
-#define MAX5821_PM_OPS NULL
-#endif /* CONFIG_PM_SLEEP */
static const struct iio_info max5821_info = {
.read_raw = max5821_read_raw,
@@ -392,7 +387,7 @@ static struct i2c_driver max5821_driver = {
.driver = {
.name = "max5821",
.of_match_table = max5821_of_match,
- .pm = MAX5821_PM_OPS,
+ .pm = &max5821_pm_ops,
},
.probe = max5821_probe,
.remove = max5821_remove,
--
2.11.0.rc2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] iio: dac: mcp4725: avoid using CONFIG_PM_SLEEP
2018-08-10 18:51 [PATCH] iio: dac: max517: avoid using CONFIG_PM_SLEEP Marcus Folkesson
2018-08-10 18:51 ` [PATCH] iio: dac: max5821: " Marcus Folkesson
@ 2018-08-10 18:51 ` Marcus Folkesson
1 sibling, 0 replies; 3+ messages in thread
From: Marcus Folkesson @ 2018-08-10 18:51 UTC (permalink / raw)
To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Marcus Folkesson
Cc: linux-iio, linux-kernel
SIMPLE_DEV_PM_OPS() is already doing this.
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
drivers/iio/dac/mcp4725.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/iio/dac/mcp4725.c b/drivers/iio/dac/mcp4725.c
index 8b5aad4c32d9..6d71fd905e29 100644
--- a/drivers/iio/dac/mcp4725.c
+++ b/drivers/iio/dac/mcp4725.c
@@ -45,7 +45,7 @@ struct mcp4725_data {
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(
to_i2c_client(dev)));
@@ -58,7 +58,7 @@ static int mcp4725_suspend(struct device *dev)
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(
to_i2c_client(dev)));
@@ -71,13 +71,7 @@ static int mcp4725_resume(struct device *dev)
return i2c_master_send(data->client, outbuf, 2);
}
-
-#ifdef CONFIG_PM_SLEEP
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,
struct device_attribute *attr, const char *buf, size_t len)
@@ -547,7 +541,7 @@ static struct i2c_driver mcp4725_driver = {
.driver = {
.name = MCP4725_DRV_NAME,
.of_match_table = of_match_ptr(mcp4725_of_match),
- .pm = MCP4725_PM_OPS,
+ .pm = &mcp4725_pm_ops,
},
.probe = mcp4725_probe,
.remove = mcp4725_remove,
--
2.11.0.rc2
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-08-10 19:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-10 18:51 [PATCH] iio: dac: max517: avoid using CONFIG_PM_SLEEP Marcus Folkesson
2018-08-10 18:51 ` [PATCH] iio: dac: max5821: " Marcus Folkesson
2018-08-10 18:51 ` [PATCH] iio: dac: mcp4725: " Marcus Folkesson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).