From: Guenter Roeck <linux@roeck-us.net>
To: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, lm-sensors@lm-sensors.org,
Jean Delvare <khali@linux-fr.org>,
Len Brown <len.brown@intel.com>, Pavel Machek <pavel@ucw.cz>,
Jingoo Han <jg1.han@samsung.com>,
Guenter Roeck <linux@roeck-us.net>
Subject: [PATCH 3/3] hwmon: (max6639) Convert to use __pm instead of #ifdef CONFIG_PM_SLEEP
Date: Thu, 9 May 2013 10:09:51 -0700 [thread overview]
Message-ID: <1368119391-13837-4-git-send-email-linux@roeck-us.net> (raw)
In-Reply-To: <1368119391-13837-1-git-send-email-linux@roeck-us.net>
Drops #ifdef from code, and ensures that conditional code still compiles
if power management is disabled. Resulting code is dropped from object file.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
drivers/hwmon/max6639.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c
index 3e7b426..6080913 100644
--- a/drivers/hwmon/max6639.c
+++ b/drivers/hwmon/max6639.c
@@ -591,8 +591,7 @@ static int max6639_remove(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int max6639_suspend(struct device *dev)
+static int __pm max6639_suspend(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG);
@@ -603,7 +602,7 @@ static int max6639_suspend(struct device *dev)
MAX6639_REG_GCONFIG, data | MAX6639_GCONFIG_STANDBY);
}
-static int max6639_resume(struct device *dev)
+static int __pm max6639_resume(struct device *dev)
{
struct i2c_client *client = to_i2c_client(dev);
int data = i2c_smbus_read_byte_data(client, MAX6639_REG_GCONFIG);
@@ -613,7 +612,6 @@ static int max6639_resume(struct device *dev)
return i2c_smbus_write_byte_data(client,
MAX6639_REG_GCONFIG, data & ~MAX6639_GCONFIG_STANDBY);
}
-#endif /* CONFIG_PM_SLEEP */
static const struct i2c_device_id max6639_id[] = {
{"max6639", 0},
@@ -622,15 +620,16 @@ static const struct i2c_device_id max6639_id[] = {
MODULE_DEVICE_TABLE(i2c, max6639_id);
-static const struct dev_pm_ops max6639_pm_ops = {
- SET_SYSTEM_SLEEP_PM_OPS(max6639_suspend, max6639_resume)
+static const struct dev_pm_ops __pm max6639_pm_ops = {
+ .suspend = max6639_suspend,
+ .resume = max6639_resume,
};
static struct i2c_driver max6639_driver = {
.class = I2C_CLASS_HWMON,
.driver = {
.name = "max6639",
- .pm = &max6639_pm_ops,
+ .pm = pm_ops_ptr(&max6639_pm_ops),
},
.probe = max6639_probe,
.remove = max6639_remove,
--
1.7.9.7
next prev parent reply other threads:[~2013-05-09 17:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-09 17:09 [PATCH 0/3] pm: Introduce __pm to mark power management code Guenter Roeck
2013-05-09 17:09 ` [PATCH 1/3] pm: Introduce __pm to mark power management functions and data Guenter Roeck
2013-05-09 17:09 ` [PATCH 2/3] hwmon: (tmp102) Convert to use __pm instead of #ifdef CONFIG_PM Guenter Roeck
2013-05-09 17:09 ` Guenter Roeck [this message]
2013-05-10 10:54 ` [PATCH 0/3] pm: Introduce __pm to mark power management code Pavel Machek
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1368119391-13837-4-git-send-email-linux@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jg1.han@samsung.com \
--cc=khali@linux-fr.org \
--cc=len.brown@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lm-sensors@lm-sensors.org \
--cc=pavel@ucw.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox