* [RESEND PATCH] iio: dac: max517: avoid using CONFIG_PM_SLEEP
@ 2018-08-11 8:47 Marcus Folkesson
2018-08-19 16:41 ` Jonathan Cameron
0 siblings, 1 reply; 2+ messages in thread
From: Marcus Folkesson @ 2018-08-11 8:47 UTC (permalink / raw)
To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
Peter Meerwald-Stadler, Marcus Folkesson
Cc: linux-iio, linux-kernel
This is already handled by SIMPLE_DEV_PM_OPS().
Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
---
Somehow git-send-email messed up (?!) the format for (at least) gmail, so resend it.
Mutt still read the mail correct though.
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] 2+ messages in thread
* Re: [RESEND PATCH] iio: dac: max517: avoid using CONFIG_PM_SLEEP
2018-08-11 8:47 [RESEND PATCH] iio: dac: max517: avoid using CONFIG_PM_SLEEP Marcus Folkesson
@ 2018-08-19 16:41 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2018-08-19 16:41 UTC (permalink / raw)
To: Marcus Folkesson
Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
linux-iio, linux-kernel
On Sat, 11 Aug 2018 10:47:09 +0200
Marcus Folkesson <marcus.folkesson@gmail.com> wrote:
> This is already handled by SIMPLE_DEV_PM_OPS().
>
> Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Applied to the togreg branch of iio.git and pushed out as testing for the
autobuilders to play with it.
thanks,
Jonathan
> ---
> Somehow git-send-email messed up (?!) the format for (at least) gmail, so resend it.
> Mutt still read the mail correct though.
>
> 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,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-19 16:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-11 8:47 [RESEND PATCH] iio: dac: max517: avoid using CONFIG_PM_SLEEP Marcus Folkesson
2018-08-19 16:41 ` Jonathan Cameron
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).