* [RESEND PATCH] iio: dac: mcp4725: avoid using CONFIG_PM_SLEEP
@ 2018-08-11 8:47 Marcus Folkesson
2018-08-19 16:43 ` 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/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] 2+ messages in thread
* Re: [RESEND PATCH] iio: dac: mcp4725: avoid using CONFIG_PM_SLEEP
2018-08-11 8:47 [RESEND PATCH] iio: dac: mcp4725: avoid using CONFIG_PM_SLEEP Marcus Folkesson
@ 2018-08-19 16:43 ` Jonathan Cameron
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Cameron @ 2018-08-19 16:43 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:25 +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.
> ---
> Somehow git-send-email messed up (?!) the format for (at least) gmail, so resend it.
> Mutt still read the mail correct though.
You have my sympathies ;) oh for all email servers and clients being well behaved.
Thanks,
Jonathan
>
> 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,
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-19 19:55 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: mcp4725: avoid using CONFIG_PM_SLEEP Marcus Folkesson
2018-08-19 16:43 ` 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).